Home Explore Blog CI



git

5th chunk of `Documentation/git-tag.adoc`
23221570c377679c4ed02f67c13651531fd7541f74b1eaa50000000100000dda

~~~~~~~~~~~~~~~~~~~~~~

If you are following somebody else's tree, you are most likely
using remote-tracking branches (eg. `refs/remotes/origin/master`).
You usually want the tags from the other end.

On the other hand, if you are fetching because you would want a
one-shot merge from somebody else, you typically do not want to
get tags from there.  This happens more often for people near
the toplevel but not limited to them.  Mere mortals when pulling
from each other do not necessarily want to automatically get
private anchor point tags from the other person.

Often, "please pull" messages on the mailing list just provide
two pieces of information: a repo URL and a branch name; this
is designed to be easily cut&pasted at the end of a 'git fetch'
command line:

------------
Linus, please pull from

	git://git..../proj.git master

to get the following updates...
------------

becomes:

------------
$ git pull git://git..../proj.git master
------------

In such a case, you do not want to automatically follow the other
person's tags.

One important aspect of Git is its distributed nature, which
largely means there is no inherent "upstream" or
"downstream" in the system.  On the face of it, the above
example might seem to indicate that the tag namespace is owned
by the upper echelon of people and that tags only flow downwards, but
that is not the case.  It only shows that the usage pattern
determines who are interested in whose tags.

A one-shot pull is a sign that a commit history is now crossing
the boundary between one circle of people (e.g. "people who are
primarily interested in the networking part of the kernel") who may
have their own set of tags (e.g. "this is the third release
candidate from the networking group to be proposed for general
consumption with 2.6.21 release") to another circle of people
(e.g. "people who integrate various subsystem improvements").
The latter are usually not interested in the detailed tags used
internally in the former group (that is what "internal" means).
That is why it is desirable not to follow tags automatically in
this case.

It may well be that among networking people, they may want to
exchange the tags internal to their group, but in that workflow
they are most likely tracking each other's progress by
having remote-tracking branches.  Again, the heuristic to automatically
follow such tags is a good thing.


On Backdating Tags
~~~~~~~~~~~~~~~~~~

If you have imported some changes from another VCS and would like
to add tags for major releases of your work, it is useful to be able
to specify the date to embed inside of the tag object; such data in
the tag object affects, for example, the ordering of tags in the
gitweb interface.

To set the date used in future tag objects, set the environment
variable GIT_COMMITTER_DATE (see the later discussion of possible
values; the most common form is "YYYY-MM-DD HH:MM").

For example:

------------
$ GIT_COMMITTER_DATE="2006-10-02 10:31" git tag -s v1.0.1
------------

include::date-formats.adoc[]

FILES
-----

`$GIT_DIR/TAG_EDITMSG`::
	This file contains the message of an in-progress annotated
	tag. If `git tag` exits due to an error before creating an
	annotated tag then the tag message that has been provided by the
	user in an editor session will be available in this file, but
	may be overwritten by the next invocation of `git tag`.

NOTES
-----

include::ref-reachability-filters.adoc[]

SEE ALSO
--------
linkgit:git-check-ref-format[1].
linkgit:git-config[1].

GIT
---
Part of the linkgit:git[1] suite

Title: Git Tag Management and Best Practices
Summary
Properly managing tags in Git is crucial, especially when working with remote repositories and different groups of people, and understanding how tags are used and shared is essential to maintaining a organized and secure Git workflow, including considerations for one-shot pulls, tag namespaces, and backdating tags.