Wednesday, December 20, 2017

KDiff3 best installation and configuration procedure for git in Windows/Ubuntu/MacOS

The installation procedure of KDiff3: 

For Windows users:

Download from https://sourceforge.net/projects/kdiff3/ and then install

git config --global --add merge.tool kdiff3
git config --global --add mergetool.kdiff3.path "C:/Program Files/KDiff3/kdiff3.exe"
git config --global --add mergetool.kdiff3.trustExitCode false 
git config --global --add diff.guitool kdiff3
git config --global --add difftool.kdiff3.path "C:/Program Files/KDiff3/kdiff3.exe"
git config --global --add difftool.kdiff3.trustExitCode false

For Ubuntu/Linux users: Installation:

sudo apt-get update
sudo apt-get install kdiff3

Then configure:

git config --global merge.tool kdiff3
git config --global mergetool.kdiff3.cmd "/usr/bin/kdiff3 --merge --result=\$MERGED \$LOCAL \$BASE \$REMOTE"
git config --global mergetool.keepBackup false
git config --global diff.tool kdiff3
git config --global difftool.kdiff3.cmd "/usr/bin/kdiff3 \$LOCAL \$REMOTE"

For MacOS users: Installation:

sudo apt-get update
sudo apt-get install kdiff3

Then configure,

git config --global merge.tool kdiff3
git config --global mergetool.kdiff3.cmd "/Applications/kdiff3.app/Contents/MacOS/kdiff3 --merge --result=\$MERGED \$LOCAL \$BASE \$REMOTE"
git config --global mergetool.keepBackup false
git config --global diff.tool kdiff3
git config --global difftool.kdiff3.cmd "/Applications/kdiff3.app/Contents/MacOS/kdiff3 \$LOCAL \$REMOTE"
Then run
$ kdiff3
or
$ git mergetool
or
$ git mergetool --tool=kdiff3 

No comments:

Post a Comment