我一直使用git commit --verbose
。在执行git rebase --interactive
期间重新编辑提交消息时,是否有相应的选项/设置可使git向我显示差异信息?
git diff HEAD^
对您没有帮助,除非您只想重新编辑最后一次提交。git commit --amend --verbose
而不更改索引,并编辑提交消息,以获得您所要求的差异视图。edit
部分而不是reword
部分,然后在每个提交上使用git commit --amend --verbose
而不更改索引中的代码。
reword
应该只是使用edit
的快捷方式,然后执行git commit --amend -m "new message"
而不进行任何更改,这将仅更改提交消息。git commit --amend --verbose
或git commit --verbose
定义为别名,以便节省一些打字,例如,您可以简单地执行git cav
或git c --amend
。edit
命令,这会将您带到 shell 中,您必须键入 git commit --amend --verbose
来编辑提交,然后键入 git rebase --continue
才能继续。相反,您可以在相应的提交后添加一行 exec git commit --amend --verbose
。这将直接将您放入该提交的编辑器中,并在您退出编辑器后继续变基。 - acranexec
部分。 - Vampiregit -c commit.verbose=true rebase --interactive
-c commit.verbose=true
,请将以下内容添加到~/.gitconfig
中:[commit]
verbose = true
参考文献:git-config
命令手册。
:r !git diff HEAD^
或类似的命令。 - chirlu