182

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?

3

2 Answers 2

428

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

Which is like writing in ~/.gitconfig:
(or in %HOMEDRIVE%%HOMEPATH%\.gitconfig)

[difftool]
  prompt = false
7
  • 19
    This is the proper solution. The answer flagged a solution, does not save any key presses. Thanks a lot. Jun 6, 2014 at 10:17
  • 2
    @sebweisgerber I just paraphrased the marked answer and discovered how to make it permanent, though. I wouldn't have probably found the option otherwise.
    – ZJR
    Sep 17, 2014 at 22:18
  • 1
    This is a better answer because it will handle the case as the default action, which will allow the question writer to continue using git-difftool as they want. Oct 19, 2015 at 18:56
  • 1
    Actually the --add option is misplaced here. It means to add the setting "prompt=false" to whatever entries of "promt" are there already, whereas the goal is to replace the current value or add it in the first place. This behaviour is achieved without --add.
    – user905686
    Aug 11, 2016 at 18:30
  • 26
    Make sure you don't put propmt = false under [difftool "toolname"]` section by accident. It doesn't work. It should be under [difftool] section.
    – Fosna
    Jul 14, 2017 at 8:42
68
man git-difftool

OPTIONS
   -y, --no-prompt
       Do not prompt before launching a diff tool.
4
  • 24
    The answer by @ZJR seems to be most people's preferred answer (including me).
    – Jono
    Apr 3, 2014 at 22:24
  • 1
    Ref to ZJR's answer (in case of user name change): stackoverflow.com/questions/7897517/… Jul 20, 2018 at 23:00
  • 1
    better answer below.
    – m1m1k
    Jun 20, 2020 at 16:57
  • @m1m1k Better comment above :-) Jul 21, 2020 at 8:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.