Versions Using the GIT Version

We plan to move to GIT from SVN in the near future. Currently, our software version format is {year}.{major}.{minor}.{revision} 2010.3.2.32465 {year}.{major}.{minor}.{revision} , for example 2010.3.2.32465 . {revision} part is automatically populated by the build script, so it’s very easy to find the exact version of the code for any build. Of course, we can use the GIT revision for the same purpose, but I'm curious that something like 2010.1.2.ce04503acce2452af1c3 will look like an ugly and less readable person, and then SVN version numbers. Assuming we have a main central repository,

  • Is it possible to track some numeric version of the type "commit number" for this repository?
  • Is it possible to track it automatically from build scripts?
  • What are the best methods for version numbers in GIT?

Any thoughts? Thanks.

+4
source share
1 answer

You can use git describe to get the commit identification on which your version is based.

See http://www.kernel.org/pub/software/scm/git/docs/git-describe.html

It provides the branch name, the number of commits, and the commit step identifier. Thus, you have an order for various releases and full identification.

+3
source

Source: https://habr.com/ru/post/1334320/


All Articles