View differences of branches with meld?

后端 未结 8 722
终归单人心
终归单人心 2020-11-30 16:30

I know that I can view the difference between HEAD and current state with meld .. But how can I view the differences between branches, for example master<

相关标签:
8条回答
  • 2020-11-30 17:13

    Starting with git v1.7.11, you can use git difftool --dir-diff to perform a directory diff. Which works quite well with meld wihout https://github.com/wmanley/git-meld scripts.

    Configure git

    git config --global diff.tool meld
    

    Use it

    git difftool -d topic             // -d is --dir-diff
    git difftool -d master..topic
    

    For macOS

    brew cask install meld
    git config --global difftool.meld.cmd 'open -W -a Meld --args \"$LOCAL\" \"$PWD/$REMOTE\"'
    git config --global difftool.meld.trustExitCode true
    
    0 讨论(0)
  • 2020-11-30 17:14

    I think a easy way for doing this is using git reset --soft:

    Goal: compare differences between branch_a and branch_b with meld

    git checkout branch_a
    git checkout -b do_diff
    git reset --soft branch_b
    meld .
    
    0 讨论(0)
提交回复
热议问题