How do I check which merge tool I use?
Asked Answered
S

4

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).

Sharper answered 12/10, 2016 at 17:34 Comment(0)
D
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.cmd
git config --get mergetool.THE_MERGE_TOOL.trustexitcode

see git help config

Diction answered 12/10, 2016 at 19:30 Comment(3)
first gives nothing, second: error: invalid key: mergetool.THE_MERGE_TOOLKata
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 kdiff3Doxy
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.Rogerrogerio
L
8

Check your configurations:

git config --list

Look for the merge.tool configuration variable.

Lil answered 12/10, 2016 at 17:36 Comment(1)
have only user.name, user.emailKata
M
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 = [email protected]
[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
Martian answered 13/10, 2016 at 4:39 Comment(0)
L
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.

Lamellicorn answered 12/10, 2016 at 17:39 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.