How to most efficiently tie a git build version number, to an apk version with eclipse?

I use eclipse to build an android app, and git running locally for version control. Currently I have a value in strings.xml that represents the version number. If i change that number, the very next thing I do is a code commit in git using the same version number in the comment, so that I can tie a specific build to the matching code that generates it. Very manual process.

Larsks comment helped in pointing me in a direction of defining things better. I think what I want is some type of git hook. Something where, if I change a particular version variable, it will automatically add a corresponding tag. Or, if I issue a tag of a specific format “v3.1.4”, it will update the version number in code.

  • What happens behind the scenes when I do a repo sync?
  • How do you download a specific release of Android source code (e.g. Android 2.2)
  • Authorization for github.com on Android
  • what folders should git ignore in an Android project
  • How to run repo android on CentOS?
  • How to resume repo sync
  • I think prior to reading about hooks, I was hoping for something where I could put “ReplaceWithVersion”, or some other special code, and on commit git would know automatically to replace that with the current tag/version.

    Am I hoping for too much? Is there a feasible way to get that the versions/tags in sync?

  • TortoiseGit remote operations fail with SSL issue : “unable to get local issuer certificate”
  • After git rm file; commit — how to get file back from the remote branch?
  • How to create an empty branch for documentation
  • Gittle - “unexpected keyword argument 'pkey'”
  • Deploy code from local to server without runnning pull command on server side
  • Partial git commit from eclipse (egit)
  • One Solution collect form web for “How to most efficiently tie a git build version number, to an apk version with eclipse?”

    This sounds like the precut use for git tags. After you update strings.xml and commit the change, tag the commit with the version number:

    git tag 3.14.15
    

    You can then use this tag in other git commands to refer to this specific commit. For example, too see any change you’ve made since a release:

    git diff 3.14.15
    
    Git Baby is a git and github fan, let's start git clone.