Git: Checkout Tag – As Branch

Tags in Git are used to label specific commits (to mark releases, for example).

Each tag points directly to a specific commit in the Git history.

In this note i will show how to checkout a tag in Git and how to create a new branch from it.

Cool Tip: How to list all tags in Git! Read more →

Git Checkout Tag

Make sure that you have the latest tag list from the remote repository locally:

$ git fetch --all --tags --prune

Checkout Git Tag

Change the repository state to a specific commit labeled by a tag:

$ git checkout <tag_name>

Switch to a previous state of the repository:

$ git checkout -

Checkout Git Tag as Branch

Create a new branch from a tag:

$ git checkout <tag_name> -b <branch_name>
Was it useful? Share this post with the world!

Leave a Reply