Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save oviniciusfeitosa/94d761350eef76bb03d30f44ce84f88e to your computer and use it in GitHub Desktop.
Save oviniciusfeitosa/94d761350eef76bb03d30f44ce84f88e to your computer and use it in GitHub Desktop.
http://programmers.stackexchange.com/questions/141973/how-do-you-achieve-a-numeric-versioning-scheme-with-git
Use tags to mark commits with version numbers:
git tag -a v2.5 -m 'Version 2.5'
Push tags upstream—this is not done by default:
git push --tags
Then use the describe command:
git describe --tags --long
This gives you a string of the format:
v2.5-0-deadbeef
^ ^ ^
| | |
| | SHA of HEAD
| |
| number of commits since last tag
|
last tag
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment