简体   繁体   English

如何获取从GIT分支创建的所有分支的列表(获取分支的所有子分支)

[英]How to get list of all branches created off a GIT branch (get all sub branches of a branch)

Is there a way to get the list of all branches created off a branch in GIT. 有没有一种方法可以获取从GIT分支中创建的所有分支的列表。

For eg If we have say Rel2 branch created off master, and then we have SP1, SP2 and SP3 created from Rel2 Branch. 例如,如果说从母版创建了Rel2分支,然后从Rel2分支创建了SP1,SP2和SP3。

Is there any command in GIT to get SP1, SP2 and SP3 as output if i give Rel2 as input ? 如果我将Rel2作为输入,GIT中是否有任何命令可以获取SP1,SP2和SP3作为输出?

Just take a commit you want and do 只需提交您想要的提交并执行

git branch --contains commitid

in your case you can also do 您也可以

git branch --contains Rel2

This will list all branches that have the given commit in their history. 这将列出其历史记录中具有给定提交的所有分支。

To list remote branches do 列出远程分支机构

git branch -r --contains commitid

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

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