How do you push tags to a remote, and why aren't tags pushed automatically with a normal push?
Last updated
Tags live in their own refs/tags/ namespace and a normal git push only updates branch refs, so you must push tags explicitly. This is deliberate: tags are permanent labels and Git avoids publishing them without your intent.
Push a single tag:
git push origin v1.0sends just that tag.Push all tags:
git push origin --tagspushes every local tag (lightweight and annotated).git push --follow-tagspushes commits plus only reachable annotated tags: cleaner for releases.
Why not automatic:
pushmoves the current branch's commits; tags are a separate namespace, not carried along.Tags are meant to be immutable and shared intentionally: silently publishing every local tag would pollute the remote.
Deleting a remote tag:
git push origin --delete v1.0(orgit push origin :refs/tags/v1.0).
- https://git-scm.com/book/en/v2/Git-Basics-Tagging
- https://git-scm.com/docs/git-push/2.38.0
- https://git-scm.com/docs/git-push
- https://git-scm.com/docs/git-push/2.8.6
- https://www.atlassian.com/git/tutorials/inspecting-a-repository/git-tag
- https://www.atlassian.com/git/tutorials/syncing/git-push
- https://www.pulumi.com/blog/trigger-deployments-on-git-tags/
- https://gitgoahead.muzammilbilwani.com/