I am in the middle of a long rebase, everything was going well until one of my git rebase --continue
's where I got this:
$ git rebase --continue
Applying: A git commit
fatal: Unable to create '/Users/me/mycode/.git/index.lock': File exists.
Another git process seems to be running in this repository, e.g.
an editor opened by 'git commit'. Please make sure all processes
are terminated then try again. If it still fails, a git process
may have crashed in this repository earlier:
remove the file manually to continue.
I didn't remove that file because it no longer existed. I guess maybe a git GUI program tried to refresh while I was rebasing or something. Ok fine. I tried again, but now I get
$ git rebase --continue
fatal: cannot resume: .git/rebase-apply/final-commit does not exist.
It's true it doesn't exist:
$ ls .git/rebase-apply/
0001 0005 0009 0013 0017 0021 abort-safety last orig-head rebasing threeway
0002 0006 0010 0014 0018 0022 apply-opt messageid patch rewritten utf8
0003 0007 0011 0015 0019 0023 head-name next patch-merge-index scissors
0004 0008 0012 0016 0020 0024 keep onto quiet sign
Is there any way out of this mess? It is a long rebase so I do not want to git rebase --abort
.
I don’t know how to fix your existing rebase but I would work around by doing another one:
cp .git/rebase-merge/git-rebase-todo ~/another-folder # backup what is to be done
git branch failed-rebase # save the current point as a branch
git rebase --abort
Then you can continue the failed rebase with:
git rebase -i --onto failed-rebase <original rebase parameters here>
It opens the editor. You should make the to-do list match what you intended originally using the original git-rebase-todo
file. Save the file, quit the editor and the rebase will start. After it finishes, remove the temporary branch.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With