Unable to diff files in two separate branches in Git

后端 未结 4 405
野性不改
野性不改 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:41

    If you're currently checkout out to branchA, for example, you can use the command:

    git diff branchB path/to/common/file/between/branches.txt
    

    You can then edit the diff if you want a subset of the changes, or leave it as is, and git apply the diff as a patch. As for a GUI tool that does this, hopefully someone else will have a suggestion there.

提交回复
热议问题