We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 34f2841 commit 6bbe4d2Copy full SHA for 6bbe4d2
book/02-git-basics/sections/tagging.asc
@@ -209,6 +209,25 @@ To [email protected]:schacon/simplegit.git
209
210
现在,当其他人从仓库中克隆或拉取,他们也能得到你的那些标签。
211
212
+==== 删除标签
213
+
214
+要删除掉你本地仓库上的标签,可以使用命令 `git tag -d <tagname>`。例如,可以使用下面的命令删除掉一个轻量级标签:
215
216
+[source,console]
217
+----
218
+$ git tag -d v1.4-lw
219
+Deleted tag 'v1.4-lw' (was e7d5add)
220
221
222
+应该注意的是上述命令并不会从任何远程仓库中移除这个标签,你必须使用 `git push <remote> :refs/tags/<tagname>` 来更新你的远程仓库:
223
224
225
226
+$ git push origin :refs/tags/v1.4-lw
227
+To /[email protected]:schacon/simplegit.git
228
+ - [deleted] v1.4-lw
229
230
231
==== 检出标签
232
233
在 Git 中你并不能真的检出一个标签,因为它们并不能像分支一样来回移动。
0 commit comments