问题描述
我刚刚搜索了 git-config(1)
, git-log(1)
和 git-show(1)
git 2.6.2的手册页,但是没有发现可以配置--show-signature
选项(例如,git show
或git log
)的任何提示在我的~/.gitconfig
中全局显示所有支持它的git
子命令.
I just searched through the git-config(1)
, git-log(1)
and git-show(1)
man pages of git 2.6.2, but haven't found any hint that the --show-signature
option (to e.g. git show
or git log
) can be configured globally in my ~/.gitconfig
for all git
subcommands that support it.
一个选项是别名,但是由于我不知道哪个子命令都支持别名,所以这只是一种解决方法,而不是解决方案.
One option would be aliases, but since I don't know which subcommands all support it, that's just a workaround, not a solution.
我猜可能是core.show-signature = yes
或core.showSignature = yes
,但这没什么改变.
I guessed it may be core.show-signature = yes
or core.showSignature = yes
but that didn't change anything.
推荐答案
我确认此--show-signature
选项(最初在提交0c37f1f,2011年10月,Git v1.7.9-rc0 ).
I confirm that this --show-signature
option (initially introduced in commit 0c37f1f, Oct 2011, Git v1.7.9-rc0) .
如 commit f2fef7b 所示,该选项是漂亮选项"的一部分" Documentation/pretty-options.txt
,其中:
使用Git 2.10(2016年第三季度)在2016年7月更新(8个月后):"git log
"学习log.showSignature
配置变量,并使用命令行选项"--no-show-signature
"来进行补偿.
Update July 2016 (8 months later), with Git 2.10 (Q3 2016): "git log
" learns log.showSignature
configuration variable, and a command line option "--no-show-signature
" to countermand it.
请参见提交fce04c3 ,提交aa37999 (2016年6月22日),提交aa37999 (2016年6月22日)和提交aefc81a (2016年6月24日)通过 Mehul Jain(mehul2029
).
See commit fce04c3, commit aa37999 (22 Jun 2016), commit aa37999 (22 Jun 2016), and commit aefc81a (24 Jun 2016) by Mehul Jain (mehul2029
).
当log.showSignature
设置为true时,git-log
和相关命令的行为就像被赋予了"--show-signature
"一样.
When log.showSignature
is set to true, git-log
and related commands will behave as if "--show-signature
" was given to them.
请注意,此配置变量旨在影响git-log
,git-show
, git-whatchanged
和git-reflog
.
其他命令,例如git-format-patch
,git-rev-list
不受此配置变量的影响.
Note that this config variable is meant to affect git-log
, git-show
, git-whatchanged
and git-reflog
.
Other commands like git-format-patch
, git-rev-list
are not to be affected by this config variable.
2017年5月更新(又11个月后)
Update May 2017 (11 more months later)
git config
手册页现在更加清晰:
The git config
man page is now clearer:
log.showSignature
这篇关于在〜/.gitconfig中要添加什么以暗示每个支持它的git子命令的--show-signature?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!