Git – Best practice for creating defined versions in git

datagitversion control

In my company we have a 'production pipeline', which is a bunch of code which we use to produce data, with the data later shipped to customers. The code is still being developed, bugs get fixed etc.

Currently, we are still using SVN, but we are on the process of moving to git. Using SVN, we used revision numbers to define specific 'points in time' to which we could come back. For example, we could tell that certain data were created using revision-1234, and monitor changes this way.

I am wondering what would be the best practice of using git for this matter. I have read about branches, tags and releases, but not sure what's the best way to go.

Best Answer

Normally, when I release a version of software, the code is tagged in Git with a sensible naming convention e.g. v1_0_0 or RELEASE_2016_02_23, etc. This creates a baseline copy of all the code as it exists at the point of the tag. You can also compare tags for differences, etc. VERY useful and simple to do in Git Bash with two commands:

git tag RELEASE_2016_02_23

Then...

git push --tags

Or...

git push origin RELEASE_2016_02_23

...to push the specific tag.

Related Topic