为什么“git difftool”不直接打开工具?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/7897517/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Why does "git difftool" not open the tool directly?
提问by Misha Moroshko
I configured git
like this:
我git
是这样配置的:
git config --global diff.tool meld
When I run:
当我运行时:
git difftool
I get the following message:
我收到以下消息:
Viewing: 'hello.txt'
Hit return to launch 'meld':
Then, if I press Enter, meld
will launch.
然后,如果我按下Enter,meld
将启动。
How can I disable this message, so that meld
will be launched straight away after typing git difftool
?
如何禁用此消息,以便meld
在键入后立即启动git difftool
?
采纳答案by Bill Door
man git-difftool
OPTIONS
-y, --no-prompt
Do not prompt before launching a diff tool.
回答by ZJR
There's also an option:
还有一个选项:
difftool.prompt
Prompt before each invocation of the diff tool.
The following command turns off the prompt globally (for all repos):
以下命令全局关闭提示(对于所有存储库):
git config --global difftool.prompt false
It's like writing (in ~/.gitconfig
or %HOMEDRIVE%%HOMEPATH%\.gitconfig
)
这就像写作(在~/.gitconfig
或%HOMEDRIVE%%HOMEPATH%\.gitconfig
)
[difftool]
prompt = false