码迷,mamicode.com
首页 > 其他好文 > 详细

Git 操作标签的一些命令

时间:2016-05-25 01:55:00      阅读:133      评论:0      收藏:0      [点我收藏+]

标签:

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

$ 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

Git 操作标签的一些命令

标签:

原文地址:http://www.cnblogs.com/LvLoveYuForever/p/5525530.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!