当应用压缩或改写的提交时,rebase -i
自动调用提交编辑器。我习惯于使用 commit -v
(我想看看我提交了什么差异),但是 rebase 调用的 git commit
好像没有设置-v
.这在压缩提交时非常烦人。
有没有办法配置git commit
用于内部的标志 rebase loop
?
最佳答案
来自 git-commit(1)
:
-v, --verbose
Show unified diff between the HEAD commit and what would be committed at the bottom of the commit message template to help the user describe the commit by reminding what changes the commit has. Note that this diff output doesn’t have its lines prefixed with
#
. This diff will not be a part of the commit message. See thecommit.verbose
configuration variable in git-config[1].
这意味着可以通过执行全局永久启用详细模式
git config --global commit.verbose true
这样,-v
从现在开始,选项将默认启用。或者,可以通过传递
-c
在每个命令的基础上启用该选项。全局选项:git -c commit.verbose=true rebase -i
关于git rebase -i 提交标志?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66966464/