Facebook Twitter Instagram
    TecAdmin
    • Home
    • Ubuntu 20.04
      • Upgrade Ubuntu
      • Install Java
      • Install Node.js
      • Install Docker
      • Install LAMP Stack
    • Tutorials
      • AWS
      • Shell Scripting
      • Docker
      • Git
      • MongoDB
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    Home»General Articles»How to Create Git tags

    How to Create Git tags

    RahulBy RahulOctober 25, 20212 Mins ReadUpdated:October 25, 2021

    Tags work as an additional identifier for a particular incident. And in the case of Git, Tags are used as the reference points in your development workflow and it denotes special events like a new version release or new commit. You can create a new tag to give a reference for your newly launched version. Tagging helps you in identifying the particular commit or release of your code in past.

    If you want to create Git tags, then you should know that there are two types of Git tags:

    • Annotated tags
    • Lightweight tags

    Annotated tags are tags with a description while lightweight tags don’t include any description. We will see how to create both of them one by one.

    Why should you create tags or what are the benefits of tags?

    • When you want to put a part of code or code point for future use reference. The tag will help you in identifying that part.
    • While creating a stable version of your code or release point.

    Now let’s see how you can create tags.

    1. To create a git tag, we use the “git tag” command and then specify the name of the tag. For example:
      git tag [tagName]
      

      So if you are creating a new tag for your latest launch then you can execute:

      git tag v1.4 
      

      Next, you can run the “git tag” command to see if you have successfully created the tag or not. This syntax will list all the existing tags.

    2. If you want to create a tag with a message then you can execute the following command.

      git tag -a [tagName] -m “Your message here”

      For example:

      git tag -a v1.4 -m "This is the new release" 
      

      You can even verify your tag by using the following command:

      git tag -n 
      

      This will display all the existing tags with messages.

    3. Your git push command will not be pushed to your remote repository automatically. And to push them you have to execute the following command:
      git push --tags 
      
    git tags
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp
    Previous ArticleHow to Check Disk Space in Ubuntu
    Next Article How to delete Git tags

    Related Posts

    How to Find Django Install Location in Linux

    Updated:April 27, 20221 Min Read

    (Resolved) – ReactJS 404 Error on Page Reload

    2 Mins Read

    Adding a New SSH Key in GitHub

    Updated:April 1, 20223 Mins Read

    13 Best Linux Terminal Emulators and Bash Editors

    8 Mins Read

    How To Install Oracle VirtualBox on Debian 11

    2 Mins Read

    10 Best Linux FTP Clients in 2022

    5 Mins Read

    Leave A Reply Cancel Reply

    Recent Posts
    • How to Install JAVA on Ubuntu 22.04
    • Switching Display Manager in Ubuntu – GDM, LightDM & SDDM
    • Changing the Login Screen Background in Ubuntu 22.04 & 20.04
    • How To Install PHP (8.1, 7.4 or 5.6) on Ubuntu 22.04
    • (Resolved) Please install all available updates for your release before upgrading
    Facebook Twitter Instagram Pinterest
    © 2022 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.