Created
May 22, 2011 22:55
-
-
Save johnagan/985983 to your computer and use it in GitHub Desktop.
A sample git hook to update webroot on commit
This file contains hidden or 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
# Bring in Source Control | |
mkdir ~/repo | |
cd ~/repo | |
git init --bare | |
# Create a git hook | |
cat > hooks/post-receive | |
#!/bin/sh | |
GIT_WORK_TREE=/home/ubuntu/www | |
export GIT_WORK_TREE | |
git checkout -f | |
chmod +x hooks/post-receive |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment