Reputation: 485
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 ?
Upvotes: 5
Views: 4333
Reputation: 51473
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
Upvotes: 6