I was going to do a rebase to delete my last commit but I didn't want to finish so I exited. (I realize this probably was not the best way to go about it, but it's done) I guess I did it wrong because I am getting the error: fatal: Could not open file .git/rebase-merge/done for reading: No such file or directory
every time I run git status
. How do I get rid of this error so I can continue making commits? Can I just delete the file? If I can delete it, how would I do that?
You can run git rebase --abort to completely undo the rebase. Git will return you to your branch's state as it was before git rebase was called. You can run git rebase --skip to completely skip the commit.
What is git rebase? Rebasing is the process of moving or combining a sequence of commits to a new base commit. Rebasing is most useful and easily visualized in the context of a feature branching workflow.
To use git rebase in the console with a list of commits you can choose, edit or drop in the rebase: Enter git rebase -i HEAD~5 with the last number being any number of commits from the most recent backwards you want to review. In vim, press esc , then i to start editing the test.
On the command line, navigate to the repository that contains the commit you want to amend. Use the git rebase -i HEAD~n command to display a list of the last n commits in your default text editor. Replace pick with reword before each commit message you want to change.
Before you try the following, make sure you stash
or commit
any uncommitted changes first, or you will lose them irrevocably.
Then try to do a git rebase --abort
.
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