Skip to content

Instantly share code, notes, and snippets.

@0xv
Created February 27, 2017 21:26
Show Gist options
  • Save 0xv/0f7004cf6b619f6015d173c6765e9ce6 to your computer and use it in GitHub Desktop.
Save 0xv/0f7004cf6b619f6015d173c6765e9ce6 to your computer and use it in GitHub Desktop.
cd /var
mkdir repo && cd repo
mkdir site.git && cd site.git
git init --bare
cd hooks
cat > post-receive
#!/bin/sh
git --work-tree=/var/www/domain.com --git-dir=/var/repo/site.git checkout -f
chmod +x post-receive
git remote add live ssh://user@mydomain.com/var/repo/site.git
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment