Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save laszlomiklosik/3874904 to your computer and use it in GitHub Desktop.
Save laszlomiklosik/3874904 to your computer and use it in GitHub Desktop.
Configure meld as git diff and merge tool
# inspired from http://nathanhoad.net/how-to-meld-for-git-diffs-in-ubuntu-hardy
# and http://gitguru.com/2009/02/22/integrating-git-with-a-visual-merge-tool/
sudo apt-get install meld
# create a python script with the below content and name it diff.py
#!/usr/bin/python
import sys
import os
os.system('meld "%s" "%s"' % (sys.argv[2], sys.argv[5]))
git config --global diff.external /path/to/diff.py
git diff filename
# the latter command should pop you up the meld diff tool
# for using meld as a merge tool run
git mergetool
# after git merge has already ran and generated conflicts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment