Working With Version Numbers

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?

  • How to avoid developers to commit without mention the issue on commit message on Github
  • How do I publish to <me>.github.com?
  • git stuck on Unpacking Objects phase
  • Hudson git plugin won't clone repo on Linux
  • SSH frozen at “SSH2_MSG_SERVICE_ACCEPT”
  • Git reports fatal: write error: invalid argument with git clone on git: protocol
  • Git fetch says “success” but nothing is downloaded
  • Unchanged files showing in Git pull request
  • One Solution collect form web for “Working With Version Numbers”

    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
    
    Git Baby is a git and github fan, let's start git clone.