I’m comparing remote branches, in order to see if a branch can safely be merged into Master, in order for Master to be released.
I’m doing the following:
git diff --name-status origin/develbranch ... origin/master
And I seem to get a correct list of files, like this:
AAAA www/images/widget/topdown/right_dis.png
DDDD www/includes/htmlpurifier/library/HTMLPurifier/DefinitionCache/Decorator.php
My questions are:
- Am I doing this correctly?
- If I merge these branches, the DDDD file won’t be deleted in Master right?
Actually, to get the diff the right way around you want to run
That should work fine, but I’ll show you some other nifty tricks:
git checkout master; git branch --no-mergedThis will show all branches that aren’t fast-forwardable to master, i.e. all non-merged branches.
git checkout master; git merge --no-ff --no-commit develbranch; git diffThis is the only way of knowing what the merge would actually look like. You can throw away the merge after you’ve looked at it with
git reset --hard.git branch --contains develbranchWill show all the branches that
develbranchcould be fast-forwarded to. This is useful for checking which branches all the changes ofdevelbranchhave been merged to.