Last Updated: February 25, 2016
·
1.209K
· jcarsique

Identify all Git refs pointing at a given ref

Know the current or given Git hash and all the tags and branches pointing at it.

$ git config --global alias.id "show -s --pretty=format:'%h%d'"

Usage: git id [some_ref]

$ git id
02a719d (HEAD, some-tag, origin/master, origin/5.6.0, master, feature-NXP-9999-some-feature, 5.6.0)

$ git id 71ecb65
71ecb65 (release-5.5.4, NXP-9998-osgi)

$ git id release-5.5.4
71ecb65 (release-5.5.4, NXP-9998-osgi)

2014/07 UPDATE: As of Git 1.8.3 (May 24, 2013), we now have automatic useful coloring using %C(auto):
$ git config --global alias.id "show -s --pretty=format:'%C(auto)%h%d'"

1 Response
Add your response

As of git 1.8.3 (May 24, 2013), add %C(auto) to colorize the output:

$ git config --global alias.id "show -s --pretty=format:'%C(auto)%h%d'"
over 1 year ago ·