# Why git tags are there in git?

5 messages from 2011-01-28 to 2011-01-29. Participants: vikram2rhyme, L. Alberto Giménez, Gabriel Filion, Konstantin Khomoutov, Enrico Weigelt.
Thread: https://gitlist.dev/t/26355

## vikram2rhyme, 2011-01-28 11:37

Subject: Why git tags are there in git?
Message-ID: <1296214676536-5969544.post@n2.nabble.com>
URL: https://gitlist.dev/e/1296214676536-5969544.post%40n2.nabble.com

```

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?
-- 
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.

```

## L. Alberto Giménez, 2011-01-28 12:27

Subject: Re: Why git tags are there in git?
Message-ID: <4D42B623.5060709@sysvalve.es>
URL: https://gitlist.dev/e/4D42B623.5060709%40sysvalve.es
In-Reply-To: <1296214676536-5969544.post@n2.nabble.com>

```
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

```

## Gabriel Filion, 2011-01-28 15:03

Subject: Re: Why git tags are there in git?
Message-ID: <4D42DABA.5060603@gmail.com>
URL: https://gitlist.dev/e/4D42DABA.5060603%40gmail.com
In-Reply-To: <4D42B623.5060709@sysvalve.es>

```
On 11-01-28 07:27 AM, "L. Alberto Giménez" wrote:
> 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.

-- 
Gabriel Filion

```

## Konstantin Khomoutov, 2011-01-28 16:06

Subject: Re: Why git tags are there in git?
Message-ID: <20110128190628.f507599e.kostix@domain007.com>
URL: https://gitlist.dev/e/20110128190628.f507599e.kostix%40domain007.com
In-Reply-To: <1296214676536-5969544.post@n2.nabble.com>

```
On Fri, 28 Jan 2011 03:37:56 -0800 (PST)
vikram2rhyme <vikram2rhyme@gmail.com> wrote:

> 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.

```

## Enrico Weigelt, 2011-01-29 17:17

Subject: Re: Why git tags are there in git?
Message-ID: <20110129171750.GA602@nibiru.local>
URL: https://gitlist.dev/e/20110129171750.GA602%40nibiru.local
In-Reply-To: <1296214676536-5969544.post@n2.nabble.com>

```
* vikram2rhyme <vikram2rhyme@gmail.com> wrote:

Hi,

> 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
-- 
----------------------------------------------------------------------
 Enrico Weigelt, metux IT service -- http://www.metux.de/

 phone:  +49 36207 519931  email: weigelt@metux.de
 mobile: +49 151 27565287  icq:   210169427         skype: nekrad666
----------------------------------------------------------------------
 Embedded-Linux / Portierung / Opensource-QM / Verteilte Systeme
----------------------------------------------------------------------

```
