Category Archives: Git hooks

Git post-receive hook to update your website after commit

The assumption is that you have your repository for instance in: ~/repos/ and your working copy of this repository in: ~/ In this case you have to create a file named post-receive in: ~/repos/ and put following code inside it: #Update your website code GIT_WORK_TREE=/home/USER_NAME/www/ git checkout -f if you also are interested in re-creating… Read More »

Git Pre-commit hook

Yesterday I have written first code in Bash Script :D. It was a pre-commit hook which checks my Javascript files against bugs using JSLint. To install it, please download JSLint from and copy executable file (I renamed it from jsl to jslint) and config file to: your_project/.git/hooks and put following code into the pre-commit… Read More »