Reputation:
What is the best way to use version numbers with Git/GitHub? I understand that when you make a commit, all previous versions are "snapshotted" so they can be retrieved. But how can you make that coincide with application/assembly version numbers?
For instance, say you have version: 1.0.0.0
and you commit it. Then you have version 1.0.0.1
and commit that. So on and so forth.
Now it's version 1.0.0.14
and you want to pull the code from version 1.0.0.5
. What's the easiest way to do that with Git/GitHub?
Upvotes: 1
Views: 223
Reputation: 992857
The best way is to use tags. Tags are like a pointer to a specific version that never changes. Create a tag like this:
git tag -a version-1.0.0.5
The above creates a tag at the current commit. (Refer to the documentation for how to create a tag pointing to a previous commit.) Push the tags to Github with:
git push origin --tags
Upvotes: 6