Skip to content

Latest commit

 

History

History
43 lines (31 loc) · 988 Bytes

File metadata and controls

43 lines (31 loc) · 988 Bytes
title 操作标签
nav
title path
Git 手册
/git_manual
order 18
  • 1.创建的标签都只存储在本地,不会自动推送到远程。打错的标签可以在本地安全删除
git tag -d v0.1

17-1

  • 2.如果要推送某个标签到远程使用git push origin <tagname> 命令
git push origin v1.0

一次性推送全部尚未推送到远程的本地标签

git push origin --tags
  • 3.删除远程标签
git tag -d v0.9 #先从本地删除
git push origin :refs/tags/v0.9 # 再从远程删除。删除命令也是`push`

小结

  • 推送一个本地标签:git push origin <tagname>
  • 推送全部未推送过的本地标签: git push origin --tags
  • 删除一个本地标签:git tag -d <tagname>
  • 删除一个远程标签:git push origin :refs/tags/<tagname>