How do I make git show diff when rewording a commit message during rebase -i?
According to your answers in the comments, executing git diff HEAD^
will not help you, except you only want to rewored the last commit.
But in this case a rebase is the wrong tool anyway. Instead you can simply do git commit --amend --verbose
without changes in the index and then edit the commit message, having the diff view you are asking for.
If you want to reword an older or multiple commit messages with having the diff view, just use the edit
stanza instead of the reword
stanza and then use git commit --amend --verbose
without code changes in the index on each of the commits.
reword
should only be a shortcut for using edit
and then do git commit --amend -m "new message"
without any changes which will only change the commit message.
You can also define git commit --amend --verbose
or git commit --verbose
as alias so you save some typing and can e. g. simply do git cav
or git c --amend
.
To show the diff:
git -c commit.verbose=true rebase --interactive
To make all commits verbose without having to specify -c commit.verbose=true
every time, add this to ~/.gitconfig
:
[commit]
verbose = true
Reference: man git-config
.