为什么“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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 12:09:49  来源:igfitidea点击:

Why does "git difftool" not open the tool directly?

gitdiffdifftool

提问by Misha Moroshko

I configured gitlike 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, meldwill launch.

然后,如果我按下Entermeld将启动。

How can I disable this message, so that meldwill 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 ~/.gitconfigor %HOMEDRIVE%%HOMEPATH%\.gitconfig)

这就像写作(在~/.gitconfig%HOMEDRIVE%%HOMEPATH%\.gitconfig

[difftool]
  prompt = false