We use Git with a central server, and our code should include the version number in the file. The way this is currently being done is as follows:
- New developer makes "git clone"
- In his local copy, he edits .git / hooks / pre-commit to call version.sh
version.sh (which is included in the root of the project) takes the version number from "git describe" and saves it in a file.
While this works, I would like to make sure that the version number is updated, even if the developer forgot to edit his binding before committing.
Since the server does not have a working copy, just calling (pre | post) -receive hooks does not work there, so I wonder if there is a way to do this.
source
share