Last active
August 29, 2015 14:15
-
-
Save jhofker/5b397e2eaebf9185477e to your computer and use it in GitHub Desktop.
post-receive hook to pull another repo on the server
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/sh | |
PUBLIC_WWW=/home/public | |
GIT_DIR=$PUBLIC_WWW/.git | |
# Pull the latest from the repo to the public dir. | |
cd $PUBLIC_WWW | |
echo Pulling. | |
git reset HEAD --hard | |
git pull | |
echo Setting permissions. | |
chmod 755 * | |
exit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Resources that were helpful (but share none of the blame if I did something stupid):
Major Ursa
torek on StackOverflow