Skip to content

Instantly share code, notes, and snippets.

@johnagan
Created May 22, 2011 22:55
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johnagan/985983 to your computer and use it in GitHub Desktop.
Save johnagan/985983 to your computer and use it in GitHub Desktop.
A sample git hook to update webroot on commit
# 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