How to use tags in git?

The tag in git from what I understand is simply tagging a specific commit with a name.

Let's just say I release version 1.5, I create a tag 1.5

Now, if the client finds an error, how can I go and β€œissue” this 1.5 codebase in my working directory?

I assume that I would perform a bug fix and then create another tag, such as 1.5.1.

Then I could merge this code into the current version, right?

+8
git
source share
3 answers
git checkout 1.5 

This will check the 1.5 tag in your working directory. Then you can make any corrections that you like, and then make another tag for version 1.5.1.

After that, just go back to the wizard (or to any branch that you are developing), and run the following command:

 git merge 1.5.1 

This will combine the changes you have made to the latest version of your code base.

+9
source share
 git tag <1.5> -a 

Then click it with

 git push --tags 

I found that you can find tag validation with:

 git tag -l git checkout <tag> 

Found more details on previous SO post

+4
source share

Now, if the client finds an error, how do I go and checkout, what is 1.5 codebase in my working directory?

 git checkout -b fix1point5 v1.5 

I assume that I will fulfill the error to fix, and then create another tag, for example 1.5.1.

 [edit edit] git add . git commit git tag v1.5.1 HEAD 

Then could I merge this code in the current version?

 git checkout master git merge v1.5.1 
+4
source share

All Articles