Elie
Elie

Reputation: 111

How to get all the branches with a certain head in git

There is a commit with commit hash = c1

How to list all the branches that have their head "pointing" (or equal) to c1 ?

Aware of how to get the branches that contain a commit, but not able to figure out the above.

Upvotes: 1

Views: 47

Answers (1)

kadewu
kadewu

Reputation: 419

According to git manual page

git branch --points-at <object>

So for example from your question

git branch --points-at c1

Upvotes: 3

Related Questions