Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git: Show list of commits during interactive rebase

Tags:

git

rebase

I'm in the middle of an interactive rebase. Is there a command that shows the list of commits that were initially selected when I started the rebase?

like image 541
friederbluemle Avatar asked Jan 11 '23 00:01

friederbluemle


1 Answers

During the interactive rebase, git updates files in your .git directory under the sub-directory rebase-merge (the exact path has changed in various versions of git, as I recall; I'm looking at git 2.0.x behavior right now).

In that directory are the files done and git-rebase-todo. These are not quite what you asked for: they're the finished parts and the not-yet-done parts, not the "pick" commands that were presented to you initially, nor necessarily the commands you've gone with (if you skipped some). There's also a git-rebase-todo.backup, which contains what was in the "todo" list after you edited it. I'm not sure if you wanted the complete list of revs or the list you chose at the time you exited the editor, but if it's the latter, the backup file is the right thing.

There is also a reference named ORIG_HEAD that points to the tip of the (original) branch that is being rebased, and .git/rebase-merge/head-name which contains the name of the branch (and the branch is not moved until the rebase is complete). You could use this, plus some of the other files, to reconstruct the originally-offered "pick" list.

like image 64
torek Avatar answered Jan 16 '23 00:01

torek