事實上Git 的推送和刪除遠程標簽命令是相同的,刪除操作實際上就是推送空的源標簽refs:
git push origin 標簽名
相當於
git push origin refs/tags/源標簽名:refs/tags/目的標簽名
git push 文檔中有解釋:
tag <<tag>> means the same as refs/tags/<tag>:refs/tags/<tag>.
Pushing an empty <src> allows you to delete the <dst> ref from the remote repository.
推送標簽:
[plain] view plain copy
- git push origin 標簽名
刪除本地標簽:
[plain] view plain copy
- git tag -d 標簽名
刪除遠程標簽:
[plain] view plain copy
- git push origin :refs/tags/標簽名
- git push origin :refs/tags/protobuf-2.5.0rc1
其他本地操作:
[plain] view plain copy
- #打標簽
- git tag -a v1.1.4 -m "tagging version 1.1.4"
- #刪除本地倉庫標簽
- git tag -d v1.1.4
- #列出標簽
- git tag
