I've ended up not having the time to finish a rebase. The problem is I don't know how to edit my original to-do list because all my current to-do's are reword
and after each time I finish rewording a commit message it automatically opens the next commit in Vim to be reworded.
If I were editing any of my commits, I could run git rebase --edit-todo
, change the rest of my commit's to pick
, then run git rebase --continue
.
Does anybody know if there's a way to edit the to-do's in my case? Or any other approach?
NOTE: I don't want to abort the rebase and lose all my work.
If set to "warn", git rebase -i will print a warning if some commits are removed (e.g. a line was deleted), however the rebase will still proceed. If set to "error", it will print the previous warning and stop the rebase, git rebase --edit-todo can then be used to correct the error.
You can run rebase interactively by adding the -i option to git rebase . You must indicate how far back you want to rewrite commits by telling the command which commit to rebase onto. Remember again that this is a rebasing command — every commit in the range HEAD~3..
Right-click on commit message Fix app crash and start interactive rebase. Set the commit you want to edit as edit . Click Start Rebasing. Whenever you found a conflict, fix it, run git add . , then run git rebase --continue again.
On the command line, navigate to the repository that contains the commit you want to amend. Use the git rebase -i HEAD~n command to display a list of the last n commits in your default text editor. Replace pick with reword before each commit message you want to change.
Try starting another shell instance somewhere, e.g., in another window or using :shell
from within vim. Make sure this shell instance is in the correct repository directory (cd path/to/repo
if necessary) and run git rebase --edit-todo
there. Write out the updated instructions and exit this editor, and then go back to the in-progress rebase. When you finish the current "reword", Git should pick up the edited instructions.
I'm concerned that there might be some difference between older versions of Git, in which git rebase -i
is all one big shell script, and newer ones where git rebase -i
uses the C coded sequencer. They are supposed to behave the same way in general, so with luck this works in all Gits, older or newer.
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