Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Forgotten rebase interactive - git

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.

like image 733
user1611830 Avatar asked Oct 02 '13 10:10

user1611830


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!

What does git rebase -- Interactive do?

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.

How do I save a git interactive rebase?

Press the Esc key, type :wq! and press Enter key to save and exit the document.

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.


2 Answers

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
like image 35
Christoph Avatar answered Oct 04 '22 14:10

Christoph


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.

like image 72
FelipeC Avatar answered Oct 04 '22 15:10

FelipeC