Created
          August 16, 2016 17:13 
        
      - 
      
- 
        Save oviniciusfeitosa/94d761350eef76bb03d30f44ce84f88e to your computer and use it in GitHub Desktop. 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | 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