Tag a stable release in Git

October 2nd 2013

This may seem like a no-brainer, but tagging releases in Git is essential to any release process.

If you aren't doing it, then you've got some issues (and not using SCM properly is one of them).

Anyway, to tag (for example) a Git repo on v1.0 you can use the following command:

Text Snippet:
$ git tag -a v1.0 -m 'Version 1.0 message goes here'

After tagging, you want to push this tag up. So use this:

Text Snippet:
$ git push origin v1.0

Think of a tag like a static branch. It's VERY helpful to be able to roll between stable versions of any codebase. And getting on board and creating a regular, stable release process makes you genuinely feel great.

Anyway, we released v1.0, so let's say you wanted a v1.2. You can probably guess, but just in case you can't:

Text Snippet:
$ git tag -a v1.2 -m 'Version 1.2 message goes here'
Text Snippet:
$ git push origin v1.2

Great, that was easy!

Visit me on Google+

Leave a comment