Question

I am using the github advice to make it work: https://gist.github.com/329690

and right now my global config file contains:

[merge]
        tool = opendiff
        external = /Users/mike/bin/git-diff-cmd.sh

[diff]
        tool = opendiff
        external = /Users/mike/bin/git-diff-cmd.sh

However, when I use gif diff, the output still comes out as text output, and so is any merge conflict when using git merge <branch>. Is there a sure way to make them use opendiff? (when using git diff and git merge and preferably not by other commands)

Was it helpful?

Solution

EDIT: full change

Not only you need merge.tool as you already set, you also need mergetool.<tool>. In the following you see the code you need (the options --merge and --result depends on opendiff):

[merge]
    tool = opendiff
[mergetool "opendiff"]
    cmd = \"/Users/mike/bin/git-diff-cmd.sh\" --merge --result=\"$MERGED\" \"$LOCAL\" \"$BASE\" \"$REMOTE\"
    trustExitCode = true
    keepBackup = false

See this Reference and search for "mergetool"

EDIT: according to the author's comment (sorry I can't spell your name) the [merge] tag is mandatory even for diff.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top