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:
- Rename folder of working copy
For examplemv /projectA /projectA_master
) - Clone the project again
git clone url
- Switch to
devel
branch
cd projectA && git -b devel origin/devel
- 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.
In git V1.7.9 you can compare two commits without the commandline:
You must configure in 'git gui' edit options, global: "Use merge tool: meld".
Start gitk, select a commit, right click another commit > "diff this --> selected". Under 'patch' right click a file > "external diff".
meld will start and display the still selected, first commit on the right side.
I cannot comment under Piort Jurkiewicz answer to the comment of pykiss : "copy new files from branch to working dir does not work :( ", but :
The solution to copy file.txt from branch_B into the working branch branch_A is :
from this answer to this question. I dont know how to do it within meld itself.
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.