2

I have a mixed C/C++ source code and the version control is done using GIT. We follow the Atlassian work flow i.e create branch from master, work on the feature branch and when this work is deemed clean by the team, merge it to the master branch.

My question is, everytime the software is merged to master, does git provide a way with which it automatically increments the software version. E.g from v1. 0 to 1.1 and so on.

I am aware of commit hashes and git tags, but that's not what I'm looking for. My goal is to output this detail in my software along with the commit that's on master.

Abel Tom
  • 145
  • 2
  • 8
  • To clarify, you're asking for a built-in semantic versioning system where each commit to master is assigned a new version, similar to automatically tagging commits? – Andrew Fan Nov 23 '19 at 05:15
  • Yes, that is exactly what I'm asking. I know it's possible using CMAKE but, I'm not aware of an inbuilt mechanism in GIT. – Abel Tom Nov 23 '19 at 05:17

1 Answers1

1

Git does not do this on its own.

You can easily add your own mechanism, and many have done so, but no two of them agree on how to do it. See also Looking for a way automate the "bump version" with git flow.

torek
  • 448,244
  • 59
  • 642
  • 775