How do you use the `git rebase --edit-todo` cmd in interactive rebase when all current to-do's are set to `reword`?

Viewed 17492

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.

2 Answers

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.

As my same experience I got same error:

error: The following untracked working tree files would be overwritten by merge:
    vtysh/vtysh_cmd.db
Please move or remove them before you merge.
Aborting
hint: Could not execute the todo command
hint: 
hint:     pick 12b0d7cf571a0296fd0e3d64cf254a1d3237d90c resolve discussion
hint: 
hint: It has been rescheduled; To edit the command before continuing, please
hint: edit the todo list first:
hint: 
hint:     git rebase --edit-todo
hint:     git rebase --continue
Could not apply 12b0d7cf5... resolve discussion

It means I want to do a work (create a file eq. vtysh/vtysh_cmd.db) but it's exist now.

solution: remove this file (rm vtysh/vtysh_cmd.db) then execute git rebase --continue

Related