简体   繁体   English

如何在git中列出包含另一个分支的分支

[英]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.

相关问题 Git列表分支合并到一个分支但不合并到另一个分支 - Git list branches merged into a branch but not into another 如何在分支创建点或之后列出包含给定提交的分支 - How to list branches that contain a given commit at or after branch creation point git branch列出上游的分支 - git branch list the branches with upstream 如何获取从GIT分支创建的所有分支的列表(获取分支的所有子分支) - How to get list of all branches created off a GIT branch (get all sub branches of a branch) Git:如何列出从特定分支创建的所有分支? - Git: How to list all branches that were created from a specific branch? Git:如何列出此分支上的提交而不是合并分支的提交 - Git: How to list commits on this branch but not from merged branches git branch-不合并<list of branches> - git branch --no-merged <list of branches> Git - 功能分支之间的冲突 - 如何避免功能分支包含另一个功能分支中的更改 - Git - conflicts between feature branches - how to avoid a feature branch contains changes in another feature branch 使用 `git branch -a` 列出所有分支不显示最近获取的分支? - List all branches with `git branch -a` does not show recently fetched branch? 获取已合并到另一个分支的分支列表 - Getting a list of branches that were merged into another branch
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM