I ran some times ago some git rebase -i
command. But I completely forgot it. Now I want to change new commits order. So I ran git rebase -i HEAD~4
, and I get normally
It seems that there is already a rebase-merge directory, and
I wonder if you are in the middle of another rebase.
But I don't even remember what this rebase was all about. How can I find what was the precise purpose of that 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!
The interactive rebase gives you a script that it's going to run. It will start at the commit you specify on the command line ( HEAD~3 ) and replay the changes introduced in each of these commits from top to bottom. It lists the oldest at the top, rather than the newest, because that's the first one it will replay.
Press the Esc key, type :wq! and press Enter key to save and exit the document.
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.
If it's an old forgotten rebase and you already moved on with things, then you probably don't care anymore (except for learning purposes) and you could just abort the old rebase with
git rebase --abort
You probably want to read .git/rebase-merge/git-rebase-todo
which contains the next rebase --interactive
commands that will be run, however, it's much easier to just abort the rebase: 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