git tags 操作
查看本地tag
git tag
查看远程 tag
git ls -remote --tags origin
创建tag
git tag -a -m"comments" <tagname> # 基于本地代码
git tag -a -m"comments" <tagname> <commit> # 基于指定commit
git tag -a -m "comments" <tagname> <oldtag> # 基于已经存在的tag
推送到远程
git push -u origin <tagname>
git push -u origin refs/tags/tagname> # 如果存在与tag同名的branch
删除 tag
# 删除本地
git tag -d <tagname>
# 删除远程tag
git push -u origin :refs/tags/<tagname>
重命名tag
git tag <newtag> <oldtag>
push新tag到远程
git push -u origin <newtag>
# or
git push -u origin --tags # push所有的本地tag到远程
# or
git push -u origin refs/tags/Nnewtag> # 如果存在与本地tag同名的branch