Reputation: 19805
I am using PHP and have a file version.php
contains the following line:
<?php
define('VERSION', '1.1.0');
define('BUILD', 'xxx');
I want the git to replace the xxx
before commit. The xxx
can be anything unique and not necessary the git hash number.
Since it is PHP script and does not require another compilation process, and since the chance of build number is very frequent, I just want to have fully automatic process such that it will be changed everytime when user commit the code.
What is the perferred way to do it?
Upvotes: 2
Views: 657