简体   繁体   中英

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?

The command

git show-branch feature master

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

我认为这是你正在寻找的命令。

git log --oneline --graph --decorate somebranch otherbranch

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM