]> git.phdru.name Git - git-scripts.git/blob - hooks/post-update
62e3b0f0818552f1d395152062094bf3e6b8ac8b
[git-scripts.git] / hooks / post-update
1 #!/bin/sh
2 # Update git-scripts after pushing to master at git-scripts.git.
3 # This hook must be in git-scripts.git/hooks/post-update.
4
5 for ref in "$@"; do
6    if [ "$ref" = refs/heads/master ]; then
7       unset GIT_DIR
8       cd ../git-scripts &&
9       if ! git remote show -n origin 2>/dev/null; then
10          git remote add origin ../git-scripts.git
11       fi &&
12       exec git pull origin master
13    fi
14 done