How to switch between the tags in Git

I am new to git. And I am facing problems while moving between the tags. I want to switch between the tags. Like if I have two versions. For example. version 1.0 version 2.0 so I want to move from version 2.0 to version 1.0 in Git.

0

2 Answers

In git, a tag is given a name, which in git terminology is its reference. A tag in reality is more like an alias to a specific commit id (which is also a reference).

See

So to switch between tags you would use the same technique that you would use to switch between other references such as branches or commits... git checkout <tagname>.

You are probably looking for:

git checkout tag

git checkout can be used to checkout any commit and after that it can be used with a branch name to go back to a named branch.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

You Might Also Like