KostaZ KostaZ - 28 days ago 5
Git Question

How to show git log for only two branches?

I want to browse git history (in bash terminal) of only specific git branches. This scenario is pretty frequent use case, because people do want to compare their "feature" branch with the "master" branch.

Naively, I tried:

git log --oneline --decorate --graph --branches=feature/my_cool_feature


But even in this case I see all the other branches.

Can anyone help with the git command (in bash terminal) to show the graph of git history for only the specified branches?

Answer

The command

git show-branch feature master

will show commits that only exist in either master or feature but not both.

Comments