不要使用--all
,然后尝试过滤存储库中的stash,而是从一开始就不包含它们:
git log --branches --remotes --tags --graph --oneline --decorate
试图在之后过滤存储库所带来的主要问题是,如果该存储库是该分支上最新的提交(因为尽管它不是该分支的head
,但它仍然是最近的后代),则实际上可以从日���中过滤掉整个分支,这不是您想要的。
我的昵称:
[alias]
l = log --oneline --decorate --graph --exclude=refs/stash
在这种情况下,您将能够使用这些表单,而无需显示stash:
git l
用于当前分支git l feature234
用于特定分支git l --all
用于整个历史记录来自手册:
--exclude=<glob pattern>
不包括与下一个--all、--branches、--tags、--remotes或--glob匹配的引用。
--all --exclude=refs/stash
仍然会包括stash,而 --exclude=refs/stash --all
将正确地将其排除。 - Mikhail Burshteyn--exclude
。例如:git log --graph --exclude=refs/heads/*.stgit --exclude=refs/patches/* --exclude=refs/stash --all
- gavenkoa
--tags
。 - cYrus--tags
是多余的,因为没有标签应该是分支或远程的head
的后代,尽管我还没有验证过。 - Andrew Marshallgit checkout -b test
创建并切换到名为 "test" 的分支;添加一个提交记录;使用命令git tag foo
打上名为 "foo" 的标签;使用命令git checkout master
切换回主分支;使用命令git branch -D test
删除名为 "test" 的分支。标签已经存在,但如果不加上--tags
参数将无法显示。 - cYrusHEAD
。否则,如果你处于脱离HEAD模式并且没有其他引用指向HEAD提交,那么你在图表中看不到它。 - mziwisky