How To Checkout/Clone Git Tags

1 Year Subscription

It’s a common DevOps practice to tag a specific commit id whenever there is a release. Also, developers tag specific commits for several uses cases.

When it comes to the application release process, whenever there is a hotfix, the fix starts from the commit id that was tagged for release.

In this blog, you will learn the follwing.

  1. Checkout a particular git tag
  2. git clone from a tag
  3. merge a git tag to a branch

Checkout Git Tag

Let’s look at different options associated with checking out a git tag.

Checkout a Git Tag To Branch

Now that you know the list of available tags, you can check out a particular tag.

For example, if you want to checkout a tag v.1.0 to a branch named hotfix-1.0, you can do so using the following git command.

git checkout tags/v.1.0 -b hotfix-1.0

List Git Tags

When you clone a repository, all the tags associated with the repository will be pulled down.

To fetch all the remote tags, use the fetch command as shown below.

git fetch --tags

You can list down all the…



UCSD DevOps CICD

Continue reading on source link

Leave a Comment

Your email address will not be published. Required fields are marked *

+ 63 = 67