Skip to content

Commit

Permalink
example of checking out a tag
Browse files Browse the repository at this point in the history
  • Loading branch information
schacon committed Oct 22, 2014
1 parent db88dce commit d401b3c
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions book/02-git-basics/sections/tagging.asc
Original file line number Diff line number Diff line change
Expand Up @@ -205,3 +205,16 @@ To [email protected]:schacon/simplegit.git
----

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

==== Checking out Tags

You can't really check out a tag in Git, since they can't be moved around.
If you want to put a version of your repository in your working directory that looks like a specific tag, you can create a new branch at a specific tag:

[source,console]
----
$ git checkout -b version2 v2.0.0
Switched to a new branch 'version2'
----

Of course if you do this and do a commit, your `version2` branch will be slightly different than your `v2.0.0` tag since it will move forward with your new changes, so do be careful.

0 comments on commit d401b3c

Please sign in to comment.