When doing a git rebase -i and, say, squashing two commits together, Git will bring up an editor with the commit messages in it for me to edit.
Normally when I do a stand-alone git commit, I use the -v option so that the message file I'm editing also includes, below the "cut" line, a diff of the commit against the previous commit.
How do I get this same commit -v behaviour when I'm doing an interactive rebase? (Note that I can't just type git commit -v manually, since the commit process is started and run for me by git rebase -i.)
One option is to set commit.verbose to true in your git configuration:
git config --global commit.verbose true
With this setting you will always get the git commit -v behavior, without needing to specify -v. If you don't want this turned on all the time, the git-config man page suggests an alternative in the documentation on creating aliases:
Note that the first word of an alias does not necessarily have to be a command. It can be a command-line option that will be passed into the invocation of git. In particular, this is useful when used with
-cto pass in one-time configurations or -p to force pagination. For example,loud-rebase = -c commit.verbose=true rebasecan be defined such that runninggit loud-rebasewould be equivalent togit -c commit.verbose=true rebase...
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