Showing commits made directly to a branch, ignoring merges in Git

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

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)