2012-04-24

Git hooks Xcode version

Xcode has two fields to set version information to app. Version is for releasing number, build is for building number, find more information in Information Property List Key Reference.


Since Xcode 4.0 starting to support git version control, so that we could bind git tag and commit hash text with Xcode field. The steps in the pseudo-code are below:


  1. $ git commit -am "COMMIT LOG"
  2. trigger post-commit hooking
  3. Setting the tag number and new commit hash to plist.


In the real code is like below:


Put the code in a file to PROJECT_FOLDER/.git/hooks/post-commit, and make it executable.

2 則留言:

j.erik 提到...

the *real code* is mssing, at least it will not be shown at the website

Alan Lu (盧利雄) 提到...

@j.erik Fixed.