Git 推送和刪除遠程標簽


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

  1. git push origin 標簽名 

刪除本地標簽:

[plain] view plain copy

  1. git tag -d 標簽名 

刪除遠程標簽:

[plain] view plain copy

  1. git push origin :refs/tags/標簽名 
  2. git push origin :refs/tags/protobuf-2.5.0rc1 

其他本地操作:

[plain] view plain copy

  1. #打標簽 
  2. git tag -a v1.1.4 -m "tagging version 1.1.4" 
  3. #刪除本地倉庫標簽 
  4. git tag -d v1.1.4 
  5. #列出標簽 
  6. git tag 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2026 CODEPRJ.COM