Why does “git difftool” not open the tool directly?

匆匆过客 提交于 2019-11-27 09:13:13

问题


I configured git like this:

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.

How can I disable this message, so that meld will be launched straight away after typing git difftool?


回答1:


man git-difftool

OPTIONS
   -y, --no-prompt
       Do not prompt before launching a diff tool.



回答2:


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)

[difftool]
  prompt = false


来源:https://stackoverflow.com/questions/7897517/why-does-git-difftool-not-open-the-tool-directly

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!