165

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?

user905686
  • 3,822
  • 8
  • 32
  • 55
Misha Moroshko
  • 148,413
  • 200
  • 467
  • 700

2 Answers2

395

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
ZJR
  • 8,394
  • 4
  • 27
  • 33
  • 18
    This is the proper solution. The answer flagged a solution, does not save any key presses. Thanks a lot. – sweisgerber.dev Jun 06 '14 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 '14 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. – Neil Monroe Oct 19 '15 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 '16 at 18:30
  • 23
    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 '17 at 08:42
  • Don't set `difftool.prompt false` without also setting `diff.tool vimdiff` (or whatever you prefer). Some day you will copy your config to a new system and you are going to get launched into a strange env. Might as well do your future self a favor and take care of everything at once. – Bruno Bronosky Nov 12 '18 at 19:35
  • Thank you @Fosna – m1m1k Jun 20 '20 at 16:56
64
man git-difftool

OPTIONS
   -y, --no-prompt
       Do not prompt before launching a diff tool.
Bill Door
  • 15,192
  • 3
  • 26
  • 35