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

后端 未结 7 2021
礼貌的吻别
礼貌的吻别 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:52

    I'm using this script which I have named git-diffx and put in my path:

    #!/bin/bash
    
    result=$(git diff $@)
    
    if [ "$result" ]; then
       echo "$result" | gitx
    fi
    

    Then instead of git diff ..., you call git diffx ....

提交回复
热议问题