Git provides a snapshot function called
tag. usually tag is used to refer to some milestone version.
Make a tag
#git tab –a tagname –m “comment”
eg: #git tag –a V1.0 –m “this is the
version 1.0”
make an tag for previous commit
#git tab –a tagname –m “comment” [commit id]
Show how many tags in the current branch
#show tag
v1.0
v2.0
Delete the tag
#git tag –d tagname
If you want to delete the tag in Git server
(eg github), we need to push it to remote server
#git push origin :refs/tags/[tagname]
Checkout the tag
Same as checkout the branch
#git checkout tagname
Push the tage to remote Git server
Push one tag
#git push origin gitname
Push all tags
#git push origin --tags
No comments:
Post a Comment