diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index f5aefea1f1b0d4a6441579159b91899a367d0813..04ba19fd317e46ea0e8277516a2e1ca39a9480f7 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -55,7 +55,7 @@ save:commitIndex:
     - git checkout -b tmpBranch || true
     - git add --all || true
     - git commit -m "Update index" || true
-    - git checkout - || true
+    - git checkout $CI_COMMIT_REF_NAME || true
     - git pull origin $CI_COMMIT_REF_NAME
     - git merge tmpBranch --ff || true
     - git push origin $CI_COMMIT_REF_NAME || true