tags – TecAdmin https://tecadmin.net How to guide for System Administrator's and Developers Mon, 25 Oct 2021 09:56:24 +0000 en-US hourly 1 https://wordpress.org/?v=6.1.1 How to delete Git tags https://tecadmin.net/how-to-delete-git-tags/ https://tecadmin.net/how-to-delete-git-tags/#respond Mon, 25 Oct 2021 08:41:03 +0000 https://tecadmin.net/?p=28220 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. [...]

The post How to delete Git tags appeared first on TecAdmin.

]]>
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.

We use tags for future reference of our previous releases and commits. And we can create and delete as per our convenience.

  1. To delete a tag from a local repository, We can use the “git tag -d” command followed by the tag name you want to delete. For example:
    git tag -d [tagName]
    

    So if you want to delete a tag v1.4 then you can execute:

    git tag -d v1.4 
    
  2. To delete tags from the remote repository, Execute the following command:
    git push origin --delete origin [tagName] 
    
  3. You can also use the git push command to delete a tag by specifying the tag name by refs syntax.
    git push origin :refs/tags/[tagName] 
    
  4. If you want to check if your tags have been deleted or not then you can list them all using “-l”
    git tag -l 
    

The post How to delete Git tags appeared first on TecAdmin.

]]>
https://tecadmin.net/how-to-delete-git-tags/feed/ 0
How to Create Git tags https://tecadmin.net/create-git-tags/ https://tecadmin.net/create-git-tags/#respond Mon, 25 Oct 2021 08:30:27 +0000 https://tecadmin.net/?p=28210 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. [...]

The post How to Create Git tags appeared first on TecAdmin.

]]>
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 
    

The post How to Create Git tags appeared first on TecAdmin.

]]>
https://tecadmin.net/create-git-tags/feed/ 0