From 77307b2782a771080cefaa73cd3bfc6bdf1adb90 Mon Sep 17 00:00:00 2001 From: alex-koziell <43379019+alex-koziell@users.noreply.github.com> Date: Tue, 25 Sep 2018 13:17:06 +0100 Subject: [PATCH 1/2] Update tagging.asc Added a brief section on one way to delete tags both locally and remotely. --- book/02-git-basics/sections/tagging.asc | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/book/02-git-basics/sections/tagging.asc b/book/02-git-basics/sections/tagging.asc index 804b29548..527469d5b 100644 --- a/book/02-git-basics/sections/tagging.asc +++ b/book/02-git-basics/sections/tagging.asc @@ -217,6 +217,25 @@ To git@github.com:schacon/simplegit.git Now, when someone else clones or pulls from your repository, they will get all your tags as well. +==== Deleting Tags + +To delete a tag on your local repository, you can use `git tag -d `. For example, we could remove our lightweight tag above as follows: + +[source,console] +---- +$ git tag -d v1.4-lw +Deleted tag 'v1.4-lw' (was e7d5add) +---- + +Note that this does not remove the tag from any remote servers. In order to update any remotes, you must use `git push :refs/tags/`: + +[source,console] +---- +$ git push origin :refs/tags/v1.4-lw +To /git@github.com:schacon/simplegit.git + - [deleted] v1.4-lw +---- + ==== Checking out Tags 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: From 681583f2598e9b9244f636f68a20f214b919511d Mon Sep 17 00:00:00 2001 From: alex-koziell <43379019+alex-koziell@users.noreply.github.com> Date: Tue, 25 Sep 2018 17:12:25 +0100 Subject: [PATCH 2/2] Update tagging.asc --- book/02-git-basics/sections/tagging.asc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/book/02-git-basics/sections/tagging.asc b/book/02-git-basics/sections/tagging.asc index 527469d5b..087ddcd03 100644 --- a/book/02-git-basics/sections/tagging.asc +++ b/book/02-git-basics/sections/tagging.asc @@ -219,7 +219,8 @@ Now, when someone else clones or pulls from your repository, they will get all y ==== Deleting Tags -To delete a tag on your local repository, you can use `git tag -d `. For example, we could remove our lightweight tag above as follows: +To delete a tag on your local repository, you can use `git tag -d `. +For example, we could remove our lightweight tag above as follows: [source,console] ---- @@ -227,7 +228,8 @@ $ git tag -d v1.4-lw Deleted tag 'v1.4-lw' (was e7d5add) ---- -Note that this does not remove the tag from any remote servers. In order to update any remotes, you must use `git push :refs/tags/`: +Note that this does not remove the tag from any remote servers. +In order to update any remotes, you must use `git push :refs/tags/`: [source,console] ----