Create Push Delete TAG GIT Example

Create Push Delete TAG GIT Example

Git TAG work same as branch and its good practice if you need to release code on Production create TAG out of branch release it. Below are the commands to achieve this:

  • Create TAG:

C:\git\javahonk> git tag -a TAG_NAME -m “TAG_NAME version released”

Example: git tag -a JavaHonk-1.0_RELEASE_TAG -m “JavaHonk-1.0_RELEASE_TAG version released”

  • See created Tag:

C:\git\javahonk> git show TAG_NAME

Example: git show JavaHonk-1.0_RELEASE_TAG

  • PUSH TAG to upstream:

C:\git\javahonk> git push upstream TAG_NAME

Example: git push upstream JavaHonk-1.0_RELEASE_TAG

  • Delete local TAG:

C:\git\javahonk> git tag -d TAG_NAME

Example: git tag -d JavaHonk-1.0_RELEASE_TAG

  • Delete upstream remote tag:

C:\git\javahonk> git push –delete upstream TAG_NAME

  • Example: git push –delete upstream JavaHonk-1.0_RELEASE_TAG

For more information please visit Git documentation here

Leave a Reply

Your email address will not be published. Required fields are marked *