简体   繁体   中英

How to show Git revisions that are either tips of branches or not merges?

I currently use git log --graph --oneline --decorate --all to look at my project's history. However, proficient use of branches causes (quite literally) half the screen to be filled with "Merge branch ..." commits.

I tried adding --no-merges , but this also excludes a commit if it is a tip of a branch, which are really important for seeing the current state of my project. Is there a way to exclude merge commits, unless they are the tip of a branch? I also want to include commits from other branches in the output.

Yo should use the following combination (The first one is not mandatory but is recommended)

git log --first-parent --no-merges

or

git log --max-parents=1

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