Friday, July 7, 2017

How to Checkout a Specific Tag in Git

Here is a quick tip which shows how to checkout a specific tag in Git.
    $ git clone <repository-link>
    $ git checkout tags/<tag-name> -b <branch-name>
The first command clones the whole repository. The second one takes a specific tag and creates a branch for it. If there are any doubts regarding the tag name, a list of tags can be retrieved via the following command:
    $ git tag -l
Specifying a branch name is actually optional. It defaults to a revision number of a tag which might not be very convenient.

3 comments:

  1. GIT is nowadays one of the frequently used programming language and being a part time worker of british essay writers I think this post needs to get a chance of a headline.

    ReplyDelete
  2. I was actually stuck and wasn’t able to find the same tag in GIT, thanks for uploading this function as we developers need that help all the time.

    ReplyDelete
  3. Needed to compose one little word yet thanks for the suggestions that you are contributed here, thanks much for the valuable information please do keep on sharing...
    Best Online Software Training Institute | Core Java Training

    ReplyDelete