I'm using GIT as my DVCS, on Ubuntu 10.04. Simply running:
meld .
in your current working directory is awesome...shows what are the diffs from your working folder to last commit.
I'd like to be able to do the same thing in other circumstances. Say I want to review the changes after I've fetched a remote branch? How would I do that? How can I review the differences with meld between two local branches... I'd love to know if there was a relatively simple way to do that.
Thx.
Meld is a visual diff and merge tool targeted at developers. Meld helps you compare files, directories, and version controlled projects. It provides two- and three-way comparison of both files and directories, and supports many version control systems including Git, Mercurial, Bazaar, CVS and Subversion.
The only change you have to make is to change the path of the Meld installed file for Mac or Linux. After setting up defaults, you can type `git difftool` within the Git local directory to launch the Windows version of Meld, or you can `git mergetool` to resolve merge conflicts as shown below.
If you like meld for comparing files and resolving merges, you should probably set the config options diff.tool
and merge.tool
to meld
, e.g.
git config diff.tool meld
You can then use git difftool master origin/master
to view the differences between your local master
and the most recently fetched version of master
from origin
. However, that will only show the differences one file at a time - you have to exit meld and hit enter to see the changes in the next file. If you'd like to see all the differences between two branches in meld, using its recursive view, there's not a one-line way of doing that, I'm afraid.
However, I wrote a short script in answer to a very similar question that takes two refs (e.g. two branches), unpacks them to temporary directories and runs meld to compare the two:
Anyway, if you've just run git fetch
you can compare the differences between your master
and the version from origin
using that script with:
meld-compare-refs.py master origin/master
... or compare two local branches with:
meld-compare-refs.py master topic1
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With