15

I want to check which merge tool my git is set to - I just don't remember the name. I know I can wait till the next merge opportunity to run it via git merge tool and see what was it, but I'd like to type something like git mergetool status to see what is the tool (and what is the version, for instance).

kiedysktos
  • 3,910
  • 7
  • 31
  • 40

4 Answers4

19

to see what git resolves as the difftool, over the different config files:

git config --get merge.tool

If the result is not a builtin, then to see how it is configured:

git config --get mergetool.THE_MERGE_TOOL

see git help config

Gregg
  • 2,444
  • 1
  • 12
  • 21
  • 1
    first gives nothing, second: `error: invalid key: mergetool.THE_MERGE_TOOL` – techkuz May 09 '19 at 06:49
  • I had previously set it to kdiff3 with `git config merge.tool kdiff3` and `git config --get merge.tool` returned `kdiff3`. I was hoping git would be able to test-launch kdiff3 – Someone Somewhere Jul 11 '19 at 23:09
  • Mine seems to be working correctly: >git config --get merge.tool unityyamlmerge is my output and unityyamlmerge is the tool I had it set to. I am guessing if you have empty output perhaps you do not have any merge tool set. I had to use git config to set my merge tool manually. – sitting-duck Aug 16 '23 at 03:00
8

Check your configurations:

git config --list

Look for the merge.tool configuration variable.

Briana Swift
  • 1,047
  • 8
  • 9
2

You can check it in your git config file: project local config file is at: .git/config global config file is at:/home/user/.gitconfig(only for linux and mac os) what config file looks like:

[user]
   name = name
   email = name@gmail.com
[color]
   ui = auto
[mergetool "[tool]"]
   cmd = vimdiff

You can use git mergetool --tool-help to show avilable merge tools. like this:

 'git mergetool --tool=<tool>' may be set to one of the following:
    emerge
    gvimdiff
    gvimdiff2
    gvimdiff3
    vimdiff
    vimdiff2
    vimdiff3
haiyang
  • 310
  • 3
  • 8
1

In your Git configuration file (typically located at ~/.gitconfig), there is a section prefixed with [mergetool]. e.g.:

[mergetool "[tool]"]
    cmd = opendiff

The cmd tells you (and--more importantly--git itself) what command to use for mergetool. In my case, it's opendiff.

Knowing this, you can view the man pages for your tool to determine what its version number is.

nasukkin
  • 2,460
  • 1
  • 12
  • 19