
How to work with Git tag
by bernt & torsten
I have put this information about git tags together, mostly so I do the right thing when I work with Git Repositories. It might be helpful information for anyone working with git.
Add New Tag
Add a new tag for the updated release
git tag -a v1.52 -m "Update to release"
Then you have to push the tag to the origin, with this command
git push origin --tags
Push tags
git push --tags
or if you are looking to push a single tag:
git push origin
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 as refs/tags/<tag>:refs/tags/<tag>
.
Push All of Your Tags at Once
git push --tags <remote>
# Or
git push <remote> --tags
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.
Delete a git tag
Deleting a git tag does not happen that often (if ever at all) but just in case, here is how to delete a tag from a remote Git repository.
Delete git tag locally:
git tag -d v1.0
Delete on remote, If you have a tag named ‘v0.5’ then you would just do this:
git tag -d v0.5 git push origin :refs/tags/v0.5
That will remove ‘v0.5’ from the remote repository.

Tech Disillusionment
For four decades, I have worked in the tech industry. I started in the 1980s when computing...

A Poem: The Consultant's Message
On a Friday, cold and gray,
The message came, sharp as steel,
Not from those we...

Using AI to Plan Wall Repair and Gutter Installation
In this article, I will share my experience using AI to plan the work required to fix a wall...