如何在git中列出包含另一个分支的分支 [英] How to list branches that contain another branch in git

查看:241
本文介绍了如何在git中列出包含另一个分支的分支的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以解释/提供一个示例,列出如何在git中列出包含另一个分支的分支吗?

Can someone explain/provide an example of how to list branches that contains another branch in git?

我可以使用contains属性吗?

can I use the contain attribute?

推荐答案

分支名称只是指向给定提交的精美指针(换句话说,它是 commitish ),因此您可以查找包含-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:

$ git branch --contains my_branch

如果还要检查远程分支,则可以添加 -r 标志:

And if you want to check remote branches as well, you can add the -r flag:

$ git branch -r --contains my_branch

这篇关于如何在git中列出包含另一个分支的分支的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆