简体   繁体   English

git rebase -i 提交标志?

[英]git rebase -i commit flags?

When applying a squashed or reworded commit, rebase -i invokes the commit editor automatically.应用压缩或改写的提交时, rebase -i会自动调用提交编辑器。 I'm used to committing with commit -v (I want to see what diff I'm committing), but the rebase-invoked git commit seems to not set -v .我习惯于使用commit -v (我想看看我提交了什么差异),但是 rebase 调用的git commit似乎没有设置-v This is super-annoying when squashing commits.这在压缩提交时非常烦人。

Is there a way to configure the git commit flags for use inside the rebase loop ?有没有办法配置git commit标志以在rebase loop中使用?

From git-commit(1) :git-commit(1)

-v , --verbose -v , --详细

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.在提交消息模板的底部显示 HEAD 提交和将提交的内容之间的统一差异,以通过提醒提交有哪些更改来帮助用户描述提交。 Note that this diff output doesn't have its lines prefixed with # .请注意,此差异 output 的行没有以#为前缀。 This diff will not be a part of the commit message.此差异不会成为提交消息的一部分。 See the commit.verbose configuration variable in git-config[1] .请参阅git-config[1]中的commit.verbose配置变量。

This means the verbose mode can be permanently enabled globally by doing这意味着可以通过执行全局永久启用详细模式

git config --global commit.verbose true

This way, the -v option will be enabled by default from now on.这样,从现在开始默认启用-v选项。

Alternatively, the option can be enabled on a per-command basis by passing the -c global option:或者,可以通过传递-c全局选项在每个命令的基础上启用该选项:

git -c commit.verbose=true rebase -i

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM