How does git tag a specific commit

   

        How does git tag a specific commit

     The default tag is on the latest commit. Sometimes, what if you forget to tag, say, it's Friday, but the tag that should be on Monday isn't, what do you do? The method is to find the commit hash value of the historical submission, and then put it on it:

  

(1) Use the git log command to view the hash value of a specific commit

$ git log --pretty=oneline --abbrev-commit

 

(2) Use the git tag command to tag

 

    There is no tag information description method:

$ git tag v0.9 xxxx

    Contains tag information description method:

 

$ git tag -a v0.1 -m "version 0.1 released" 3628164

 
   Description: The
    command git tag <name> is used to create a new tag, the default is HEAD, and a commit id can also be specified;

    git tag -a <tagname> -m "blablabla..." can specify tag information;

    git tag -s < tagname> -m "blablabla..." can sign tags with PGP; (rarely used)

    command git tag can view all tags.

 

 

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326518228&siteId=291194637