Create a tag in a GitHub repository

后端 未结 7 1536
逝去的感伤
逝去的感伤 2020-12-02 03:04

I have a repository in GitHub and I need to tag it.
I tagged in a shell, but on GitHub, it is not showing up.

Do I have to do

相关标签:
7条回答
  • 2020-12-02 03:58

    Creating Tags

    Git uses two main types of tags: lightweight and annotated.

    Annotated Tags:

    To create an annotated tag in Git you can just run the following simple commands on your terminal.

    $ git tag -a v2.1.0 -m "xyz feature is released in this tag."
    $ git tag
    v1.0.0
    v2.0.0
    v2.1.0
    

    The -m denotes message for that particular tag. We can write summary of features which is going to tag here.

    Lightweight Tags:

    The other way to tag commits is lightweight tag. We can do it in the following way:

    $ git tag v2.1.0
    $ git tag
    v1.0.0
    v2.0.0
    v2.1.0
    

    Push Tag

    To push particular tag you can use below command:

    git push origin v1.0.3
    

    Or if you want to push all tags then use the below command:

    git push --tags
    

    List all tags:

    To list all tags, use the following command.

    git tag
    
    0 讨论(0)
提交回复
热议问题