Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why git doesn't push tags by default?

Tags:

git

git-tag

The default behavior of Git is not to push tags from a local repository to an associated remote one. In this answer it is explained how to change this behavior for a single repository.

My question, is why is this the designed behavior of Git? In particular what are the cons of setting on automatic push of tags?

like image 657
Dror Avatar asked May 30 '13 06:05

Dror


People also ask

Does git push tags by default?

Sharing tags is similar to pushing branches. By default, git push will not push tags. Tags have to be explicitly passed to git push .

What does git push follow tags do?

The new " --follow-tags " option tells " git push " to push relevant annotated tags when pushing branches out. That won't push all the local tags though, only the one referenced by commits which are pushed with the git push .

Why is push not working in git?

If git push origin master not working , all you need to do is edit that file with your favourite editor and change the URL = setting to your new location. Assuming the new repository is correctly set up and you have your URL right, you'll easily be able to push and pull to and from your new remote location.

Do git tags apply to all branches?

Yes! The difference between a branch name and a tag name is that a branch name is expected to move, and git will move it automatically in that "on a branch" case.


1 Answers

If you consider the tags of any large project (kernel linux, git itself, ...) you would see tags in the hundreds.

A Distributed VCS is all about publication: what do you want to push?
Everything? All the time?

Pushing all tags can pollute the tags space from the upstream repo.

With the current behavior, you keep the control of what you are publishing to the upstream repo, for others to see.


Note that since git 1.8.3 (April 2013), the git push --follow-tags can help you push commits and their associated tags in one command.

See "Push git commits & tags simultaneously".

like image 143
VonC Avatar answered Oct 05 '22 18:10

VonC