Git 推送和刪除遠端標籤

大搜車-自娛發表於2014-04-01
http://blog.csdn.net/shines/article/details/8558293

事實上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.

推送標籤:
git push origin 標籤名

刪除本地標籤:
git tag -d 標籤名

刪除遠端標籤:
git push origin :refs/tags/標籤名

git push origin :refs/tags/protobuf-2.5.0rc1
其他本地操作:


#打標籤
git tag -a v1.1.4 -m "tagging version 1.1.4"

#刪除本地倉庫標籤
git tag -d v1.1.4

#列出標籤
git tag

相關文章