Jonathan Nieder wrote:
#!/bin/bash
# Sync gh-pages branch with master
#########################################
git checkout gh-pages
git rm -rf -q .
git checkout master -- .
git add .
git commit -am "Syncing gh-pages with master"
git checkout master
Correction: I misread this one. It was guarded with
if [ `git rev-parse --abbrev-ref HEAD` == "master" ]; then
...
fi
which makes all the difference. Another example is to compute ctags:
#!/bin/sh
~/bin/hook_ctags.sh >/dev/null 2>&1 &
Here's a fun one that updates a timesheet:
https://github.com/GokhanArik/git-hooks-timesheet
Sorry for the noise,
Jonathan