Created
April 5, 2011 22:22
-
-
Save ghickman/904708 to your computer and use it in GitHub Desktop.
Post-Receive hook. Runs when the repository is pushed to.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
while read oldrev newrev refname | |
do | |
if [ "$refname" == "refs/heads/master" ]; then | |
WORKDIR=/path/to/local/repo | |
export GIT_DIR=$WORKDIR/.git | |
pushd $WORKDIR >/dev/null | |
git pull --quiet >/dev/null | |
# run some code | |
popd >/dev/null | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment