Marten Bauer Marten Bauer - 1 year ago 72
Git Question

View differences of branches with meld?

I know that I can view the difference between HEAD and current state with

meld .
. But how can I view the differences between branches, for example
with meld?

At the moment I do the following steps:

  1. Rename folder of working copy

    For example
    mv /projectA /projectA_master

  2. Clone the project again

    git clone url

  3. Switch to

    cd projectA && git -b devel origin/devel

  4. View differences with meld

    meld /projectA_Master projectA

Isn't there an easier way to get the same result in meld? I only need it to review the changes and not primarily for merging.

Answer Source

I also found this issue annoying so I've made git meld which allows a more comfortable way of diffing arbitrary commits against the working tree or the staging area. You can find it at . It's a bit like Mark's script but works for comparing any arbitrary commit or the staging area or the working directory against any of the others. If one of the things you are comparing against is the working tree then that is read-write also so you don't lose your changes.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download