Reputation: 23042
When I want to find the commits that are in branch A
but not in branch B
I often write
git log A ^ B
But according to the SO post How do I see the commit differences between branches in git? the following does the same thing:
git log B..A
Are these commands identical? What is the difference?
Upvotes: 2
Views: 455
Reputation: 520968
From the official documentation for git log
covering History Simplification we find:
--ancestry-path
When given a range of commits to display (e.g. commit1..commit2 or commit2 ^commit1), only display commits that exist directly on the ancestry chain between the commit1 and commit2, i.e. commits that are both descendants of commit1, and ancestors of commit2.
It seems from the documentation itself that either git log ^ B
and git log A..B
behave identically, and the ^
and ..
operators can be used interchangeably with git log
.
Upvotes: 3