5

On Ubuntu 18.04, git mergetool --tool-help results in:

'git mergetool --tool=<tool>' may be set to one of the following:
        araxis

The following tools are valid, but not currently available:
    bc
    bc3
    codecompare
    deltawalker
    diffmerge
    diffuse
    ecmerge
    emerge
    examdiff
    kdiff3
    meld
    opendiff
    p4merge
    tkdiff
    tortoisemerge
    vimdiff
    vimdiff2
    vimdiff3
    winmerge
    xxdiff

I would like to use vimdiff with mergetool but after googling I can't get it listed as 'available'.

5
  • Corrected the typo in the question, I wasn't spelling vimdiff wrong. Commented Mar 29, 2019 at 13:13
  • Was the next line of output going like this : "Some of the tools listed above only work in a windowed environment. If run in a terminal-only session, they will fail."? Because it seems to say so in the doc. Commented Mar 29, 2019 at 13:16
  • Yes it was. I thought the ones which required a GUI were gvimdiff, gvimdiff2 etc. Commented Mar 29, 2019 at 13:20
  • @RomainValeri, by "terminal-only" session, does it include for example a different tty without X? If so, I can use vimdiff there as a mergetool. Commented Mar 29, 2019 at 13:27
  • 2
    On my systems, vimdiff is just a symbolic link to vim. The ubuntu ones use a crazy mess of /etc/alternatives sometimes but ultimately you just invoke vim as vimdiff to get vimdiff out of it. Commented Mar 29, 2019 at 13:48

2 Answers 2

4

Actually, it turns out the answer is that vim is not shipped with Ubuntu 18.04 and other versions, even though I've been using vim.tiny for months via the vi command, which is in the PATH on installation.

Installing vim via apt install vim will also install vimdiff, among other utilities. Now the mergetool can be configured to vimdiff.

Sign up to request clarification or add additional context in comments.

1 Comment

Here's what I get on Ubuntu 18.04: vimdiff Command 'vimdiff' not found, but can be installed with: sudo apt install vim sudo apt install vim Reading package lists... Done Building dependency tree Reading state information... Done vim is already the newest version (2:8.0.1453-1ubuntu1.1). 0 upgraded, 0 newly installed, 0 to remove and 25 not upgraded.
0

Does it work if you add the following in your ~/.gitconfig:

[merge]
    tool = vimdiff

?

4 Comments

This is what I get when I run git mergetool after configuring vimdiff as the tool: The merge tool vimdiff is not available as 'vim'
But....that's the point of the --tool option : being able to use a tool without setting it in config.
Fair point @RomainValeri. Maybe silly question, but is vimdiff installed on your machine? I had a look at my output of git mergetool --tool-help, vimdiff was available, but for example meld was not, after I installed meld it became available in the list.
@padawin I think you're in fact right : I've overlooked something here with the software being installed on the system. I have to look into this. The crazy thing is.... here on a Windows machine without vimdiff I just had it in the "may be set" part of the list. And my actually configured (and VERY windowed) tool, BeyondCompare is listed under "not available".... what the hell.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.