Git log the difference between 1 branch from another

I have 2 branches A and B.

Whenever I run an assembly, Branch A merges into Branch B. I want to be able to email all updates made to A from the last time the assembly was launched. How can I use git log to be able to copy all commits made in since the last merge A → B?

+46
git git-merge git-log
Jul 26 '12 at 18:58
source share
2 answers

This will

 git log B..A 

eg. "display all commits that are in A but not in B" or if you want to do this against non-local branches

 git log origin/B..origin/A 
+74
Jul 26 '12 at 19:02
source share

Alternative syntax:

 $ git log refA refB --not refC 

or in your case comparing only two branches

 $ git log A --not B 

Also from GIT SCM Commit Ranges Docs

When comparing two branches, it really comes down to preference. I just find this more readable and no need to worry about obfuscating A...B with A..B (also mentioned in the docs).

+16
Jun 09 '14 at 19:48
source share



All Articles