Skip to contentSkip to conversation

Why git tags are there in git?

DISCUSSION vikram2rhyme 5 participants 5 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

Hello friends
I am wondering why the tags are there in git. As they are just pointer to the commit
we can refer those commit by SHA sum only then why tagging? Moreover a commit can
be tagged more than once that result in multiple tags pointing to the same point in the history.
Is this a design flaw?

Signature · 2 lines
View this message in context: http://git.661346.n2.nabble.com/Why-git-tags-are-there-in-git-tp5969544p5969544.html
Sent from the git mailing list archive at Nabble.com.
#1 lore raw
Quoted 7 lines · On Fri, 28 Jan 2011 03:37:56 -0800 (PST) vikram2rhyme <[email protected]>…

I am wondering why the tags are there in git. As they are just pointer to the commit
we can refer those commit by SHA sum only then why tagging? Moreover a commit can
be tagged more than once that result in multiple tags pointing to the same point in the history.
Is this a design flaw?

Amending what other commenters said, I should note that beyond regular tags which just provide human-readable names to objects, there exist so-called "annotated tags" which are tags with descriptive messages contained in them, which can be used as a side-channel to provide additional information for commits, and also to digitally sign a line of history to which such a tag is attached.

Also note that a tag can be attached to any object in a Git database, not necessarily to a commit. This can be occasionally useful.

#2 lore raw
In reply to vikram2rhyme
Quoted 5 lines · On 28/01/2011 12:37, vikram2rhyme wrote:

Hello friends
I am wondering why the tags are there in git. As they are just pointer to the commit
we can refer those commit by SHA sum only then why tagging?

Hi, I tend to find easier "release-v1" than 2cff0e391ab127ae...

Regards,
L. Alberto Giménez

#3 lore raw
Quoted 9 lines · L. Alberto Giménez
Quoted 5 lines · On 28/01/2011 12:37, vikram2rhyme wrote:

Hello friends
I am wondering why the tags are there in git. As they are just pointer to the commit
we can refer those commit by SHA sum only then why tagging?

Hi, I tend to find easier "release-v1" than 2cff0e391ab127ae...

In general, tags are used for marking a point in time. That marker won't move, whereas branches can move with time.

For example, in most projects tags are used to make it easier to refer to commits that mark official releases. In git.git (git's own repository), the tag v1.7.3.5 points to the release with the same number.

Signature · 1 line
Gabriel Filion
#4 lore raw
In reply to vikram2rhyme

* vikram2rhyme <[email protected]> wrote:

Hi,

Quoted 5 lines

I am wondering why the tags are there in git. As they are just pointer to the commit we can refer those commit by SHA sum only then why tagging? Moreover a commit can be tagged more than once that result in multiple tags pointing to the same point in the history. Is this a design flaw?

No, it's an important design aspect.

Tag references (not to be mixed up w/ tag objects) are very useful to add a conveniently named pointer to some object (not necessarily a commit), so humans as well as programs can easily find them.

For example, in my OSS-QM repositories [1], I have some robots importing releases (sometimes from upstream's git repos, sometimes from foreign VCSs, tarballs or even distro packages) and tag them into a normalized namespace, so automatic systems (eg. my Briegel buildsystem) can easily fetch sourcetrees from there w/o further manual tweaking.

cu

[1] http://www.metux.de/download/oss-qm/normalized_repository.pdf

Signature · 8 lines
----------------------------------------------------------------------
 Enrico Weigelt, metux IT service -- http://www.metux.de/

 phone:  +49 36207 519931  email: [email protected]
 mobile: +49 151 27565287  icq:   210169427         skype: nekrad666
----------------------------------------------------------------------
 Embedded-Linux / Portierung / Opensource-QM / Verteilte Systeme
----------------------------------------------------------------------