Nanfeng

Notes on software development, code, and curious ideas

Comparing Files Between Git Branches with Beyond Compare

Branch switching, merging, and comparison are routine development tasks. This is a convenient visual way to compare two Git branches.

Install Git and a licensed copy of Beyond Compare, then configure it once:

1
2
3
git config --global diff.tool bc
git config --global difftool.bc.path "C:/Program Files/Beyond Compare 5/BCompare.exe"
git config --global difftool.prompt false

Adjust the executable path for your installation.

Compare files one at a time:

1
git difftool branch1 branch2

Open all differences as a folder comparison:

1
git difftool -d branch1 branch2
+