Skip to content

Instantly share code, notes, and snippets.

@owainlewis
Last active August 29, 2015 13:57
Show Gist options
  • Select an option

  • Save owainlewis/9549117 to your computer and use it in GitHub Desktop.

Select an option

Save owainlewis/9549117 to your computer and use it in GitHub Desktop.
# Setup our folder structure
cd /var
sudo mkdir -p fshionable
sudo mkdir -p fshionable/site.git
cd /var/fshionable/site.git
# Create a bare git repo to receive our push
git init --bare
# Create a hook that runs when we push our code
cd /var/fshionable/site.git/hooks/
sudo touch post-receive
sudo nano post-receive
# Add this to your post-receive hook
#!/bin/sh
git --work-tree=/var/www/fshionable --git-dir=/var/fshionable/site.git checkout -f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment