简体   繁体   English

是否有一个等同于git mergetool的命令行.-- keepBackup global config

[英]is there a command line equivalent to git mergetool.--keepBackup global config

而不是必须在全局配置中设置它(这是开发人员共享存储库时的问题),在我们的脚本中自动执行此操作会很好,但是git mergetool --help没有提供任何东西。

You can pass any configuration variable to git using the -c option , eg: 您可以使用-c选项将任何配置变量传递给git ,例如:

git -c mergetool.keepBackup=false mergetool

should run git mergetool with mergetool.keepBackup set to false . 应该运行git mergetool并将mergetool.keepBackup设置为false

That's a bit long, so you may want to alias this, eg 这有点长,所以你可能想要别名,例如

alias.mt '!git -c mergetool.keepBackup=false mergetool'
alias.mtk '!git -c mergetool.keepBackup=true mergetool'

in the appropriate config file. 在适当的配置文件中。 Then git mt and git mtk should run git mergetool with keepBackup set to false and true respectively. 然后git mtgit mtk应该运行git mergetoolkeepBackup分别设置为falsetrue

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

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