I have cloned a remote Git repository to my laptop, then I wanted to add a tag so I ran
git tag mytag master
When I run git tag
To expand on Trevor's answer, you can push a single tag or all of your tags at once.
git push <remote> <tag>
This is a summary of the relevant documentation that explains this (some command options omitted for brevity):
git push [[<repository> [<refspec>…]] <refspec>...
The format of a
<refspec>
parameter is…the source ref<src>
, followed by a colon:
, followed by the destination ref<dst>
…The
<dst>
tells which ref on the remote side is updated with this push…If:<dst>
is omitted, the same ref as<src>
will be updated…tag
<tag>
means the same asrefs/tags/<tag>:refs/tags/<tag>
.
git push --tags <remote>
# Or
git push <remote> --tags
Here is a summary of the relevant documentation (some command options omitted for brevity):
git push [--all | --mirror | --tags] [<repository> [<refspec>…]] --tags
All refs under
refs/tags
are pushed, in addition to refspecs explicitly listed on the command line.
To push a single tag:
git push origin <tag_name>
And the following command should push all tags (not recommended):
git push --tags
Tags are not sent to the remote repository by the git push command. We need to explicitly send these tags to the remote server by using the following command:
git push origin <tagname>
We can push all the tags at once by using the below command:
git push origin --tags
Here are some resources for complete details on git tagging:
http://www.cubearticle.com/articles/more/git/git-tag
http://wptheming.com/2011/04/add-remove-github-tags