184

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
  • 4,491
  • 8
  • 39
  • 60
Misha Moroshko
  • 166,356
  • 226
  • 505
  • 746

2 Answers2

434

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
  • 9,308
  • 5
  • 31
  • 38
  • 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
  • 28
    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
  • 1
    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
  • @BrunoBronosky I had set `[merge]` to use tool (and it worked). This uses `[difftool]`. Am I missing any... tool? – mazunki Sep 27 '21 at 16:06
68
man git-difftool

OPTIONS
   -y, --no-prompt
       Do not prompt before launching a diff tool.
Bill Door
  • 18,272
  • 3
  • 32
  • 37