dbkaplun dbkaplun - 1 year ago 107
Git Question

How do I get all refs that point to a commit in git?

Is there any way to get a list of refs (including tags, branches, and remotes) that point to a particular commit in git?

Answer Source

git show-ref | grep $(git rev-parse HEAD) shows all refs that point to HEAD, the currently checked out commit.

git show-ref shows all refs in your git repo.

git show-ref | grep "SHA goes here" shows all refs that point to the SHA of a commit.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download