git gitk 只显示指定的分支
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/23992934/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
gitk display only specified branches
提问by robC
I want to compare 2 branches using gitk, without the clutter of other branch histories.
I can achieve this via the gui: View > New view > Branches & tags: v0.8.x v0.9.x
I tried the following, but it still shows all branches: gitk --branches v0.8.x v0.9.x
What is the correct syntax?
我想使用 gitk 比较 2 个分支,没有其他分支历史的混乱。
我可以通过 gui 实现这一点:视图 > 新视图 > 分支和标签:v0.8.x v0.9.x
我尝试了以下操作,但它仍然显示所有分支:gitk --branches v0.8.x v0.9.x
正确的语法是什么?
回答by eckes
gitk v0.8.x v0.9.x
does it for me.
gitk v0.8.x v0.9.x
为我做。
However, a closer look on the displayed branches shows me that there are actually not the given branches displayed. In addition, all branches that point to a commit in the history of the two branches are also shown.
但是,仔细查看显示的分支会发现实际上没有显示给定的分支。此外,还显示了两个分支的历史记录中指向一个提交的所有分支。
So, the command displays all branches that are specified including those branches that are direct ancestors of the ones specified.
因此,该命令显示指定的所有分支,包括那些是指定分支的直接祖先的分支。
Edit:
编辑:
The --branches=
switch would be used if you want to see all branches that are, for example, named fix/*
:
--branches=
如果您想查看所有分支,例如,named ,则将使用该开关fix/*
:
gitk --branches=fix/*
would show you all branches that are matching the given shell glob.
将向您显示与给定 shell glob 匹配的所有分支。
See also the docs of gitk
for a deeper explanation.
另请参阅 的文档gitk
以获得更深入的解释。