Marten Bauer Marten Bauer - 1 month ago 8
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
master
and
devel
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
    devel
    branch

    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

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 https://github.com/wmanley/git-meld . 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.

Comments