I want to change a pretty old commit message using:
git rebase -i sha1-of-commit^
That's nice, I do git commit --amend
and edit the message, but things get bad when I do:
git rebase --continue
I encounter multiple conflicts but don't understand why as the whole conflict resolution has obviously already been done in the past, and git should just move forward until all commits are rebased.
How can I finish the rebase quickly without having to handle these old conflicts? I just want to change a simple (and old) commit message after all...
Make a small script in your
/bin
directory (or any directory in your path) namedgit-reword-commit
. (You can name it whatever you want as long as the name starts withgit-
. This will work regardless of whether there are merge commits or not.To use, execute
Warning: This will rewrite many commits, so the same issues that apply to rebase, apply here as well, i.e., you will need to force when you push, and other users will have to know about this.
Git puts your original refs (from before the filter-branch) in
.git/refs/original
. You can use the following aliases to undo/confirm any filter-branch command.