I ‘m just learning to give project versions.
I understand writing details about the changes in my project when committing, but where should I put my version number for my project?
3
To build on MichaelT’s answer, you can just add a Git “tag” to mark a particular commit as a canonical version of your code.
Assuming your most-recent commit on the master
branch is the commit you would like to tag:
$ git tag 0.1.0
…or whatever version you would like to set it to. In the future, if you, or someone else would like to work with that specific version of your code, all that would need to be done (after an initial git-clone
of your repository) would be to run:
$ git checkout tags/0.1.0
If you are looking for a sensible scheme to follow for your projects’ versions, I highly recommend SemVer, as following a standard scheme for your projects’ version makes it much easier to parse (if the need ever arises). SemVer also provides guidelines as to how to bump your version numbers.
2