0

Using Gitlab-CI, I have a lot of runners that commit to the same repo. There are more an more commits, and now I face some new problems :

In some cases, there is a git error :

fatal: It seems that there is already a rebase-merge directory, and
I wonder if you are in the middle of another rebase.  If that is the
case, please try
    git rebase (--continue | --abort | --skip)
If that is not the case, please
    rm -fr ".git/rebase-merge"
and run me again.  I am stopping in case you still have something
valuable there.

The shell code is the following :

git add ${FILE}
git commit -m "$COMMIT_MESSAGE" -m "$COMMIT_DESCRIPTION" || true
git pull --rebase origin ${CI_COMMIT_REF_NAME}
git push --set-upstream origin ${CI_COMMIT_REF_NAME}

How can I fix such error ?

Jean
  • 1,707
  • 3
  • 24
  • 43
  • First try `git rebase --abort`. See https://stackoverflow.com/q/55045740/7976758 Found in https://stackoverflow.com/search?q=%5Bgit%5D+fatal%3A+It+seems+that+there+is+already+a+rebase-merge+directory – phd Jul 12 '23 at 18:29
  • The command is run in an automated script. I can't run this command each time ? – Jean Jul 13 '23 at 14:34
  • Does the problem happen every time now or only if new commits appear on the target branch between when the job starts and when it tries to push? If it only happens sometimes, if the rebase is failing due to merge conflicts, depending on what the new commit does, it may be difficult to automate fixing that. Maybe just give up and run the job again. What does the commit modify? – TTT Jul 14 '23 at 21:50

0 Answers0