When using git, is there a way to show commits made to a branch, while ignoring all commits that were brought in by merging?
I'm trying to review the code changes made on a branch while ignoring the ones we made on other branches that were merged in. I know it's damn near impossible to show a diff in that fashion, but I'd like to be able to find out which commits I need to review.
--no-merges
Both parents have equal weight in many contexts in git. If you've always been consistent in merging other changes in then you may find that this gives you what you want.
git log --no-merges --first-parent
Otherwise you may be able to exclude commits from other named branches.
git log --no-merges ^other-branch-1 ^other-branch-2 ^other-branch-3
If you want to review the changes that you are going to merge back into a principal branch then the easiest thing to do is to perform the merge on a local clone and then just look at the diff with the first parent before publishing the merge.