简体   繁体   English

混入git日志以显示某些分支

[英]Globbing in git log to show certain branches

I have a project with lots of branches, and I want to log only these branches: 我有一个有很多分支的项目,我只想记录这些分支:

foo/bar
foo/bar-baz
origin/foo/bar
origin/foo/bar-baz

What glob pattern do I need to do this? 我需要什么球形图案? I've tried foo/bar* 我已经尝试过foo/bar*

git log --decorate --oneline --graph foo/bar*

which shows me foo/bar and foo/bar-baz only. 仅显示foo/barfoo/bar-baz

Thanks to ElpieKay for the solution. 感谢ElpieKay提供的解决方案。 This does the trick: 这可以解决问题:

git log --decorate --oneline --graph --glob=*foo/bar*

You can get a better understanding of how to glob by taking a look at the refs/ folder in .git/ . 通过查看.git/中的refs/文件夹,您可以更好地了解如何进行glob。 heads/ contains the references to the local branches the glob looks at; heads/包含对glob所查看的本地分支的引用; likewise remotes/ contains the refs to the origin branches 同样, remotes/包含对原始分支的引用

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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