Sunday, October 02, 2011

How to get meld working with git on Windows

Inspired by these instructions, I followed these steps:

  1. Install Python 2.6
  2. Install PyGTK All-in-one installer
  3. Install meld

Then you need to configure git to be able to find and invoke meld.  If you’re using the git bash shell, this can be done with these commands:

PATH=$PATH:/c/python26
git config --global merge.tool meld
git config --global mergetool.meld.path /c/Users/andarno/Downloads/meld-1.5.2/bin/meld

Of course you may want to set your PATH to include Python permanently rather than the above command which only works for your active window.  The two git config commands have a persistent effect already, however.

Finally, you’re now ready to use meld to resolve merge conflicts.  I haven’t found a way to get “git gui” to invoke the merge tool correctly, but this command from the git bash shell works great:

git mergetool 

4 comments:

  1. I found the post very useful.Thanks for the article.

    ReplyDelete
  2. Thanks for the easy to follow instructions Andrew. I've taken one step further and added git-meld to support full diff's. See http://www.danwalkes.com/2012/06/gitmeldwindows/

    ReplyDelete
  3. I've created an installer for Meld to make this process easy: https://code.google.com/p/meld-installer/. I've also got zip archives of the installer's contents.

    ReplyDelete