13 September, 2016

How to create tag on github

How to create tagging on git.



Really creating tag is  one of the best practice for development and maintain version. 


As per my understanding production release for your code is a nightmare , we don't know what will happen ???????

Also to maintain the code base stable and safety we need this tagging. This is quite often developers do goooooogle for tagging the their code (branch / master) for safety and reference future use.

This is quite simple , and below example will help you to understand the commands on command line.

Clone your code branch (use clone command to clone the code)

git clone https://your.user.name@stash.jdgnet.com.au/scm/enabler/testcode.git

Switch your expected branch (i.e.  bugfix/jdctagging) , which you want to create tagging and make sure you are inside the expected branch.

dev@jdg-developer-desktop ~/jdgtaggingdemo/test $ git checkout bugfix/jdctagging
Branch bugfix/testing set up to track remote branch bugfix/jdctagging from origin.
Switched to a new branch 'bugfix/jdctagging'
dev@jdg-developer-desktop ~/jdgtaggingdemo/test $ git branch
* bugfix/jdctagging
  master


Create the tag with below command, you can specify the tag version name.

dev@jdg-developer-desktop ~/jdgtaggingdemo/test $ git tag -a "v1.taging.version1" -m "commiting with for test tagging for my branch code"

Check the tag got created on above command.

dev@jdg-developer-desktop ~/jdgtaggingdemo/test $ git tag
v1.taging.version1

Push the newly created tag into remote server (stash)

dev@jdg-developer-desktop ~/jdgtaggingdemo/test $ git push origin v1.taging.version1
Password for 'https://your.user.name@stash.jdgnet.com.au':
To https://your.user.name@stash.jdgnet.com.au/scm/enabler/test.git
 * [new tag]         v1.taging.version1 -> v1.taging.version1

If you don't want to push the tag by name and you want to push all tags then use below command. In my example I have only created one tag and I didn't use the below command.


git push origin --tags


Now you can see the [new tag] got created on remote server. See the snapshot below , showing the tag on stash.






Hope it will help you.





Follow for more details on Google+ and @Facebook!!!

Find More :-

No comments:

Post a Comment