如果标签打错了,也是可以删除:

$ git tag -d v0.1
Deleted tag 'v0.1' (was d96a49b)

 如果要推送某个标签到远程,使用git push orign tagname;

$ git push origin v0.2
Username for 'https://github.com': lvloveyuforever@gmail.com
Password for 'https://lvloveyuforever@gmail.com@github.com':
Counting objects: 1, done.
Writing objects: 100% (1/1), 805 bytes | 0 bytes/s, done.
Total 1 (delta 0), reused 0 (delta 0)
To https://github.com/LvLoveYuForever/gitskill.git
* [new tag] v0.2 -> v0.2

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

$ git push origin --tags

如果标签已经推送到远程,要删除远程标签就要麻烦一点,先从本地删除:

$ git tag -d v0.2

然后从远程删除,删除命令也是push,格式如下:

LV@LV-PC MINGW32 /c/gitskill (master)
$ git push origin :refs/tags/v0.2
Username for 'https://github.com': lvloveyuforever@gmail.com
Password for 'https://lvloveyuforever@gmail.com@github.com':
To https://github.com/LvLoveYuForever/gitskill.git
- [deleted] v0.2

相关文章:

  • 2022-12-23
  • 2021-07-31
  • 2022-12-23
  • 2022-12-23
  • 2021-08-14
  • 2021-08-31
  • 2021-08-23
  • 2021-12-25
猜你喜欢
  • 2022-02-20
  • 2022-01-09
  • 2021-11-30
  • 2022-01-12
  • 2021-09-21
  • 2021-06-18
  • 2021-07-24
相关资源
相似解决方案