How do i create annotated or lightweight git tags?



  • git tag man page: http://bit.ly/2ph2I8q

    lightweight tags are generally used to tag a commit and annotated tags are used to tag a release of software.

    To add a lightweight tag to a commit.

    $ git tag "demo" 72f8aba22137f5ff37f2ed8411935400e5ea7a9c
    

    To add an annotated tag, an annotated tag creates another object which references the commit, and does not just add it to the commit.

    $ git tag -a v1.4 -m "Lastorders Version 1.4"
    

    You can see this in.

    $ cat .git/refs/tags/v1.4
    4248ecd3964cd38ec31c11b0376ab95b46428c25
    

    Viewing that hash values with the git cat-file command.

    $ git cat-file -p 4248ecd3964cd38ec31c11b0376ab95b46428c25
    object 72f8aba22137f5ff37f2ed8411935400e5ea7a9c
    type commit
    tag v1.4
    tagger Trainer1 <[email protected]> 1493125468 +0100
    
    Lastorders Version 1.4
    

    You can list your tags using this command.

    $ git tag -l
    

    You can delete you tags using this command.

    $ git tag -d v1.4
    Deleted tag 'v1.4' (was 4248ecd)
    

Log in to reply
 

© Lightnetics 2024