DEV Community

A Tutorial for Tagging Releases in Git

Nesha Zoric on June 11, 2018

Tags are a simple aspect of Git, they allow you to identify specific release versions of your code. You can think of a tag as a branch that doesn't...
Collapse
 
arkaprovob profile image
Arkaprovo • Edited

Recently I gave a demonstration on "Tagging Releases in Git" in my organization. We short of implemented feature branching, and then I found having multiple long lived branches are nightmare.
Tagging for the version management is the best option, however I was not very confident, but after reading this article I think we are heading towards right direction.
Thank you, keep up the good work.

Collapse
 
mmubasher profile image
mmubasher

Wouldn't it be great that you share it on dev.to and have you own article published? Sharing is caring isn't it @arkaprovob

Collapse
 
stephaneeybert profile image
Stephane Eybert

Okay, we know now how to create tags. But why do we want to do that ? Who is using these tags we created ? And what do they do with these tags ? Thanks !

Collapse
 
paul4156 profile image
Paul Zhang

Anyone wants to switch to a specific version can do it easily with tags (git checkout v1.2.3 -b v1.2.3)

Collapse
 
davidbruchmann profile image
David Bruchmann

Tags are used for package-management (i.e. composer for PHP) and allow many automated tasks from testing to deployment where manual steps are not required anymore or minimized to the least amount of individual work. It's possible to do those things with "dev-main" too but that's an undefined and usually just most recent version, so it's not easily reproduceable if something is changed by further commits.

Collapse
 
lancerkind profile image
Lance Kind

Nesha, nice article. My summary of lightweight tags versus annotated, is that annotated tags are more suitable for enterprise code releases due to the formality of having commiter's user name and date. Perhaps a lone developer working in the wild can get by just fine by lightweight tagging releases.

Cheers and thank,
Lancer

Collapse
 
sang2306 profile image
Sang Le

Thanks!

Collapse
 
smakintel profile image
Kavashgar

thanks bro

Collapse
 
jackharner profile image
Jack Harner πŸš€

Do you tag before the commit bumping the version, or after it?

Collapse
 
paul4156 profile image
Paul Zhang

Should be done after.