Tag Archives: git

Git post-receive hook to update your website after commit

The assumption is that you have your repository for instance in: ~/repos/www.example.com/repository.git and your working copy of this repository in: ~/www.example.com In this case you have to create a file named post-receive in: ~/repos/www.example.com/repository.git/hooks and put following code inside it: #Update your website code GIT_WORK_TREE=/home/USER_NAME/www/www.example.com/ 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 http://www.javascriptlint.com/ 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 »

Git Autocompletion

Create a .git_settings directory in (actually you can choose any): Users/username/ copy following file from git sources: git_source_files/contrib/completion/git-completion.bash execute following command to edit bashrc file: mate /etc/bashrc and add following lines: #git autocompletion source ~/.git_settings/git-completion.bash Now you can go to your repository and type: git st<tab>