[英]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. 我目前使用git log --graph --oneline --decorate --all
来查看我项目的历史记录。 However, proficient use of branches causes (quite literally) half the screen to be filled with "Merge branch ..." commits. 但是,熟练使用分支导致(非常字面)一半的屏幕被“Merge branch ...”提交。
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. 我尝试添加--no-merges
,但如果它是分支的一个提示,这也排除了提交,这对于查看我的项目的当前状态非常重要。 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
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.