I have 2 branches A and B.
Whenever I run a build, Branch A gets merged into Branch B. I want to be able to email out all the updates made in A, since the last time the build was ran. How can I use git log
to be able to copy all the commits made in A since the last A -> B merge?
On the Github, go to the Source view of your project. You will see a link named 'Branch List'. Once the page opens you can see a list of all the remote branches. Hit on the Compare button in front of any of the available branches to see the difference between two branches.
To see the changes between two commits, you can use git diff ID1.. ID2 , where ID1 and ID2 identify the two commits you're interested in, and the connector .. is a pair of dots. For example, git diff abc123.. def456 shows the differences between the commits abc123 and def456 , while git diff HEAD~1..
That'll be
git log B..A
E.g. "display all commits that are in A but not in B" Or if you wish to do it against non local branches
git log origin/B..origin/A
An alternative syntax would be to use:
$ git log refA refB --not refC
or in your case of comparing only two branches
$ git log A --not B
Also from the GIT SCM Commit Ranges Docs
When comparing two branches it really comes down to preference. I just find this a bit more readable and don't have to worry about confusing A...B
with A..B
(also mentioned in the docs).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With