Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions book/02-git-basics/sections/tagging.asc
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,27 @@ 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 <tagname>`.
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 <remote> :refs/tags/<tagname>`:

[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:
Expand Down