One of the things I’ve found myself doing more of is merging in code for other people. Most of this are changes/additions/deletions to XML files. And one thing that is really annoying to do is doing these by hand. Well, fortunately there is a great tool for helping with this. it’s called Meld. To get it to play nicely with git we have to do one small thing. Create a bash script called “git-meld” and put in your bin directory
#!/bin/bash
meld $2 $5
Then make it executable with chmod. Now add the following to your ~/.gitconfig file
[diff]
external = git-meld
This will now run meld whenever you do a git diff. You can easily see diffs and apply diffs with it now. If you click the arrow in the blue/green box it will move that chunk of code over. If you diff multiple files, meld will run with each one of the files, so just quit out of meld and it will relaunch with the next file.

That works, thanks.
Be careful with the quotes around $2 and $5, they are wrong.
meld “$2″ “$5″ (right)
meld “$2″ “$5″ (wrong)
Sorry, wordpress replace the quotes
That is right:
[sourcecode language="bash"]
#!/bin/bash
meld “$2″ “$5″
[/sourcecode]
Hey thanks, that helped.
But I actually had to remove the quotes to make it work. Maybe it changed over time?
I too had to remove the quotes. It works fine without them.
One can also use the “git difftool” command, which has direct knowledge of many diffing tools, including meld.
By default it always asks for which diffing tool to use (and defaults to ‘meld’ on my box), but you can automate the choice with configuration variables. See “git help difftool” for details.
I still find this helpful. Thanks!
Thanks! This helped me out. I’d like it if there was such an option.
Even easier is just to launch meld in a Git repository. Meld understands Git repositories and will show modified files in a natural way, with diffs. Works for Mercurial and SVN too.
Use command
git config –global diff.external git-meld
not to bother with editor.