You may have a working directory for your repo on your server. In post-receive, git pull the working directory, update the version.txt file as needed and commit and click. This will cause post-reception again, so be careful how you perform your conditional update, otherwise it will go into a loop.
#!/bin/sh unset GIT_DIR cd /path/to/repo.wd git pull echo "new content" > version.txt git add version.txt git commit -m "updating version.txt" git push origin master
source share