Unable to diff files in two separate branches in Git

后端 未结 4 401
野性不改
野性不改 2020-12-12 16:01

I have FileA in branchA and FileB in branchB.

The problem is that I can access only one file at time. I would like to be able to compare the files by FileMerge or mel

4条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-12 16:50

    You can use "git mergetool" for merging, and in modern git (meaning version 1.6.3 and later) "git difftool" for comparing using graphical tools. Of course you would have to configure them first, but they do some autodetection (with some hardcoded preference, of course), and if I remember correctly opendiff support is built in.

    And then of course you would be able to use your graphical tool (opendiff / FileMerge) as you would use ordinary "git diff", for example

    prompt> git difftool somebranch:UNREADME otherbranch:README
    

提交回复
热议问题