Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I get the todo-list from a concluded git rebase -i?

Tags:

git

Say that I've done a large cleanup of my commit history with git rebase --interactive. I've gone through every commit and marked it either as squash / pick / delete and reordered commits to make them more focused. I then realize that I've made a mistake and would like to change some things, is it possible to get the todo-list with all of the changes I made back after I have concluded the rebase?

like image 638
David Hambraeus Avatar asked Dec 01 '25 09:12

David Hambraeus


1 Answers

fluffy's comment is entirely correct: once the rebase is finished, Git deletes the entire temporary directory in which the various chunks of rebase information were stored, including the rebase-to-do file. By repeating the rebase (via information stored in reflogs) you can have Git construct an all-new rebase-to-do file, but it won't have any edits you made to it.

The only solution here is to save the instructions somewhere else, in addition to in the file that Git constructed. You'll have to do this semi-manually, but perhaps you can teach your editor to do this automatically by recognizing the format of a git rebase to-do file name and saving it not only back in the original name, but also somewhere else.

(My own method for handling particularly complex rebases is not to use git rebase directly. I make a new branch, and then either use rebase on it if that seems like the way to go, or do my own individual cherry-picks and other operations if that seems like the way to go. Different situations tend to call for different tools.)

like image 147
torek Avatar answered Dec 03 '25 23:12

torek



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!