How do you make git diff use gitx --diff on OS X

后端 未结 7 2099
礼貌的吻别
礼貌的吻别 2020-12-23 23:14

Gitx has a great diff viewer, how do I make git automatically pipe git diff whatever into gitx?

I\'ve tried to set git config diff.external to a shell scrip

7条回答
  •  青春惊慌失措
    2020-12-23 23:49

    I did this for Araxis merge, but modifying these basic instructions should not be hard for whatever you perferred tool is.

    First I created ~/bin/git-diff-driver.sh and added execute permission to the file.

    
    #!/bin/sh
    
    /usr/local/bin/compare -title1:"$1 (repo version)" -title2:"$1 " -max "$2" "$5"
    

    Araxis installs it's command line interface tools in /usr/local/bin The compare tool is their generic tool and the araxis* tools feed through compare.

    Once this is set up the following lines need to be added to ~/.gitconfig

    
    [merge]
        tool = araxismerge
    [mergetool "araxismerge"]
        cmd = "/usr/local/bin/compare -3 -merge -wait $LOCAL $BASE $REMOTE $MERGED"
        path = /usr/local/bin/
    [diff]
        external = "/Users/mark/bin/git-diff-driver.sh"
    

    This redirects all 2-way and 3-way diffs through Araxis Merge. It seems like the "path =" shouldn't be necessary, but it works.

    Good Luck.

提交回复
热议问题