12.25.09
Using Compare It! with Git
Git is becoming more and more popular as version control system, thanks to it’s famous creator. Here are few advices on how you can use Compare It! (or any other external comparer) as a difference tool. Note that since Compare It! does not yet support 3-way merge, you can only use it as a difference viewer.
I have to admit that I’m not even close to a pro-git user, so if you have some corrections or improvements, please feel free to let me know.
Here and later I will use D:\Git as your Git installation folder.
1. Starting comparison from command line
Open D:\git\etc\gitconfig and add these keys and sections:
[difftool "wincmp"]
cmd = F:/Wincmp/wincmp3.exe $LOCAL //=\"Old version\" $REMOTE
[alias]
cmp = difftool --tool=wincmp
Note that backslashes in path were replaced by normal slashes (/) - git requires this change.
Now to compare branches, you can say:
- git cmp master - to compare current folder state with indexed master branch;
- git cmp master v1.0 - to compare current master and v1.0 branches.
In either case git will prompt you before invoking CompareIt for each changed file. It’s a bit awkward, but git also have some UI!
2. Using CompareIt it GitK.
Type gitk in command line to start git toolkit. Select menu Edit>Options, and in the middle of large dialog you will see option to set difference viewer. Just select CompareIt there.
Now when viewing changes in specific commit in patch mode, you can right click file and select Difference viewer there. Unfortunately this doesn’t seem to work when viewing changes between 2 branches, but maybe this will be fixed in future.