Daniel C. Sobral
Daniel C. Sobral

Reputation: 297155

How do I tell on GIT whether a reference is a branch or a tag?

How do I tell, given an arbitrary reference, whether it is a branch, a tag or something else?

Upvotes: 2

Views: 66

Answers (1)

Wolf
Wolf

Reputation: 4452

First, you fully expand the ref:

git rev-parse --symbolic-full-name v1.9-rc2

...where v1.9-rc2 is the ref I care about. That gives me the full reframe refs/tags/v1.9-rc2. Tags start with refs/tags, branches start with refs/heads.

Upvotes: 3

Related Questions