Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How do I tag a particular branch?

Sajeev Madusuthanan
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 13, 2018
Also once I tag it how do I get that particular tagged code and debug it etc.

2 answers

1 vote
Jason_Fowler
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 13, 2018

Unfortunately in Git tags and branches are mutually exclusive - in Git you tag a point in the history, a commit, and give it a name.

You create tags like this git tag -a tag_name

You push your tags to remote servers like this git push origin tag_name

You checkout tags like this: git checkout tag_name

Checkout the Git tagging documentation here: https://git-scm.com/book/en/v2/Git-Basics-Tagging

Mercurial is different though, and I am no where near experienced enough with it to be of any use. The documentation on Mercurial's tags is here: https://www.mercurial-scm.org/wiki/Tag

Mamadou BA
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
September 13, 2018

You have two kinds of tags in git : Lightweight Tags and Annoted tags

You can read the docs and create your tag depending on your need.

0 votes
Hellmut Adolphs September 13, 2018

If you are using Git, you tag the same way you would tag in any other git source control platform.    The same is the case with Mercurial.

Now if you are wondering about how do this in CI (using pipelines), the tagging depends on your building framework.  Are you building a java project? a NodeJS project? etc...  If you are using maven for java use the scm plugin: https://maven.apache.org/scm/maven-scm-plugin/examples/scm-advance-features.html#tag

If you are for example building something in nodejs you will probably be using npm or yarn. using npm you would probably tag your builds with something like:

npm --unsafe-perm version patch 

(assuming a clean repo during build npm will automatically create a git tag for you and push it).

to get the code and debug it... again it depends on wether you are using git or mercurial... but basically you have to use a git client (or mg client) and checkout the tag into your computer.  If you want to work on it, you will have to branch it first either locally (or in your origin and pull it).

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events