[英]How to list branches that contain another branch in git
Can someone explain/provide an example of how to list branches that contains another branch in git? 有人可以解释/提供一个如何列出git中包含另一个分支的分支的示例吗?
can I use the contain attribute? 我可以使用contains属性吗?
A branch name is just a fancy pointer to a given commit (in other words, it's a commitish ), so you can look for branches that contain it with the --contains
option: 分支名称只是指向给定提交的精美指针(换句话说,它是commitish ),因此您可以使用--contains
选项查找包含该分支的分支:
$ git branch --contains my_branch
And if you want to check remote branches as well, you can add the -r
flag: 而且,如果还要检查远程分支,则可以添加-r
标志:
$ git branch -r --contains my_branch
Sounds like you want to know about git branch --contains whatever-branch
. 听起来好像您想了解git branch --contains whatever-branch
。 Use -r if you want to check remote branches as well. 如果还要检查远程分支,请使用-r。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.