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.
Take Your Brand Up a Notch
So, your brand's been jogging comfortably along the marketing track, maybe even breaking...
The AI boom – a ticking energy bomb
Yes, the rise of artificial intelligence indeed presents a conundrum, not unlike the many...
Three Ideas To Keep Your Construction Business Running Smoothly
If your construction business is currently struggling, then you need to work out how to get...