tags:

views:

70

answers:

2

How do you tag your release versions in git?

Now I have each release identified by build number, but they increment even if there are no changes in the repo. My idea is to have it generated automatically on successful deployment on staging server. E.g.

  • run Hudson build
  • when successful, add new tag, i.e. 1.0-1
  • on next successful build add next tag, 1.0-2
  • version tag is displayed then in site footer

This would require:

  • Hudson to manage next version numbers
  • or script to store last tag in some file
  • or parse git tags to determine last

Any tips?

+1  A: 

What you are talking about is more akin to a technical revision number like the one a git describe would generate.

That is different from a true application version, which you should still managed independently from Hudson since it depends on a versioning policy.

VonC
+1  A: 

Hudson automatically tags the build, if you use the git plugin and let Hudson extract the code. I'm not sure if this gets pushed automatically; in our set up we do extra tagging and include a 'git push --tags' in our build script, so we definitely see the Hudson tags in our central repository.

Graham Perks