5

Is there a way to get the list of all branches created off a branch in GIT.

For e.g. If we have say Rel2 branch created off master, and then we have SP1, SP2 and SP3 created from Rel2 Branch.

Is there any command in GIT to get SP1, SP2 and SP3 as output if i give Rel2 as input ?

2
  • This might help git-scm.com/docs/git-show-branch, maybe something like git show-branch --all Commented Nov 27, 2014 at 9:58
  • Well I did see that but it doesnt serve the purpose (all switches and modifications, i end up getting all branch commits / branches which I have provided as a key string. Commented Nov 27, 2014 at 11:45

1 Answer 1

6

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 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.