How do you push a tag to a remote repository using Git?


I added a tag to the master branch on my machine:

git tag mytag master

How do I push this to the remote repository? Running git push gives the message:

Everything up-to-date

However, the remote repository does not contain my tag.


To push a single tag:

git push origin <tag_name>

And the following command should push all tags (not recommended):

# not recommended
git push --tags

Git number of commits per author on all branches

How is a tag different from a branch in Git? Which should I use, here?