Reputation: 1269
Revision A is some days old, revision B some months old. Yet when using git log A..B
or git log A...B
, I get revisions that are some years old. That makes no sense to me. How do I single out the history of commits that are both children of A and parents of B ?
Upvotes: 0
Views: 34
Reputation: 60013
You can use the --ancestry-path
option of git log
:
--ancestry-path
When given a range of commits to display (e.g.commit1..commit2
orcommit2 ^commit1
), only display commits that exist directly on the ancestry chain between thecommit1
andcommit2
, i.e. commits that are both descendants ofcommit1
, and ancestors ofcommit2
.
In your case, you would say:
git log --ancestry-path A..B
To get the commits that are both children of A
and parents of B
.
Upvotes: 1