Skip to content

Commit e81eafd

Browse files
authored
Merge pull request #1112 from alex-koziell/patch-1
Update tagging.asc
2 parents 86cb413 + 681583f commit e81eafd

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

book/02-git-basics/sections/tagging.asc

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,27 @@ To [email protected]:schacon/simplegit.git
217217

218218
Now, when someone else clones or pulls from your repository, they will get all your tags as well.
219219

220+
==== Deleting Tags
221+
222+
To delete a tag on your local repository, you can use `git tag -d <tagname>`.
223+
For example, we could remove our lightweight tag above as follows:
224+
225+
[source,console]
226+
----
227+
$ git tag -d v1.4-lw
228+
Deleted tag 'v1.4-lw' (was e7d5add)
229+
----
230+
231+
Note that this does not remove the tag from any remote servers.
232+
In order to update any remotes, you must use `git push <remote> :refs/tags/<tagname>`:
233+
234+
[source,console]
235+
----
236+
$ git push origin :refs/tags/v1.4-lw
237+
To /[email protected]:schacon/simplegit.git
238+
- [deleted] v1.4-lw
239+
----
240+
220241
==== Checking out Tags
221242

222243
If you want to view the versions of files a tag is pointing to, you can do a git checkout, though this puts your repository in ``detached HEAD'' state, which has some ill side effects:

0 commit comments

Comments
 (0)