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?
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.
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