23 Handling Remote Tags and Branches

You can push your tags to a remote repository by one of two mechanisms: you can call git push and supply the tag name as the reference to push, or you can add the --tags parameter to git push to push all your tags to the remote.

Most tags are fetched automatically. Fetching changes from master that has several tags in its history causes Git to fetch those tags as well. Like git push --tags, you can explicitly fetch tags via git fetch --tags.

Be careful with tags, however. Remote tags always win when there are two tags with the same name. For example, consider if your repository has a v1.0 tag that points to a specific commit, and your remote repository has a v1.0 tag that points to a different commit. ...

Get Pragmatic Guide to Git now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.