Reputation: 44613
Is there a way to list commits from branch A that aren't in branch B, but if there are any commits that are in A and B, but reverted in B, show those as well?
Something similar to:
git log --oneline A ^B
So, let's say I have branch C that was merged into A, and then accidentally merged into B. The merge was then reverted in B. B still technically contains the commits from C, so the above command won't list the commits in C... but in my case, I want the command to also show such commits.
Upvotes: 2
Views: 461
Reputation: 968
If you used git revert
to revert the commits, you should see in git log A..B
the "merge" commit and the "revert merge" commit.
Then you will have to use the answer from this question to show what commits were in this reverted merge.
In short :
git log $(git merge-base --octopus $(git log -1 --pretty=format:%P THE_HASH_OF_THE_MERGE_COMMIT))..THE_HASH_OF_THE_MERGE_COMMIT
Upvotes: 1