67

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?

4

2 回答 2

110

那会

git log B..A

例如“显示所有在 A 中但不在 B 中的提交”或者如果您希望针对非本地分支执行此操作

git log origin/B..origin/A
于 2012-07-26T19:02:13.257 回答
22

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).

于 2014-06-09T19:48:09.093 回答