diff --git a/buildscript.sh b/buildscript.sh
index a6e4311ce0d51fd010d260483a9913dfa7b4ccef..155e15cf0440cec3879e17a0a9723eabc17a41d9 100755
--- a/buildscript.sh
+++ b/buildscript.sh
@@ -1,7 +1,5 @@
 #!/bin/bash
 
-GLUON_REMOTE_BRANCH="v2023.2.x"
-
 # get location of executed file.
 EXECDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
 
@@ -55,7 +53,7 @@ clean_patches(){
   if [ -f "$EXECDIR/.patched" ]; then
     local base="$EXECDIR"
     cd "$EXECDIR"/.. || exit 1
-    git reset --hard "origin/$GLUON_REMOTE_BRANCH"
+    git reset --hard "origin/$(git rev-parse --abbrev-ref HEAD)"
     cd "$EXECDIR" || exit 1
     rm "$EXECDIR/.patched"
   else
@@ -66,7 +64,7 @@ clean_patches(){
 update_patches() {
   local base="$EXECDIR"
   cd "$EXECDIR"/.. || exit 1
-  git format-patch "origin/$GLUON_REMOTE_BRANCH" -o "$EXECDIR/gluon_patches"
+  git format-patch "origin/$(git rev-parse --abbrev-ref HEAD)" -o "$EXECDIR/gluon_patches"
   cd "$base" || exit 1
 }
 
@@ -216,7 +214,7 @@ get_target_list(){
 
 
 if ! git -C "$EXECDIR"/.. rev-parse --abbrev-ref HEAD | grep -q "$GLUON_AUTOUPDATER_BRANCH"; then
-  echo "no gluon repo found or wrong branch (should be $GLUON_REMOTE_BRANCH). Please clone this git repository into the gluon git repository"
+  echo "no gluon repo found or wrong branch. Please clone this git repository into the gluon git repository"
   exit 1
 fi