Put this in a file called pre-push
in .git/hooks/
#!/bin/sh
VERSION=$(git rev-list HEAD --count)
echo "Version number is: $VERSION"
sed -i -e "/.*RELEASE_VERSION*./ s/.*/define('RELEASE_VERSION', '${VERSION}');/" config/geral.php
# Optional step
# git add config/geral.php &&
# git commit -m "update release version for ${VERSION}"