Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fix "corrupted" interactive rebase?

People also ask

How do I get out of interactive rebase?

Git Rebasing Aborting an Interactive Rebase To do this, simply delete all commits and actions (i.e. all lines not starting with the # sign) and the rebase will be aborted!

How do I edit a rebase interactive?

Just right-click on the commit you want to edit and select Interactively Rebase from Here… Select reword on the commit and click Start Rebasing. Edit the commit message and click Resume Rebasing.


I got stuck in this. I created the head-name file, and then I ran into another error saying it couldn't find the onto file, so I created that file. Then I got another error saying could not read '.git/rebase-apply/onto': No such file or directory.

So I looked at the git documentation for rebasing and found another command:

git rebase --quit

This set me back on my branch with no changes, and I could start my rebase over again, good as new.


It looks like Git tried to remove the .git/rebase-merge directory but wasn't able to remove it completely. Have you tried copying that folder away? Also copy away the .git/rebase-apply folder if that is present.


I had a similar problem due to a zombie vim.exe process. Killing it in Task Manager, followed by a git rebase --abort fixed it.


Thanks @Laura Slocum for your answer

I messed things up while rebasing and got a detached HEAD with an

 error: could not read orig-head

that prevented me from finishing the rebasing.

The detached HEAD seem to contain precisely my correct rebase desired state, so I ran

rebase --quit

and after that I checked out a new temp branch to bind it to the detached head.

By comparing it with the branch I wanted to rebase, I can see the new temp branch is exactly in the state I wanted to reach. Thanks