Skip to content

Instantly share code, notes, and snippets.

@riebschlager
Last active December 28, 2015 11:19
Show Gist options
  • Save riebschlager/7492971 to your computer and use it in GitHub Desktop.
Save riebschlager/7492971 to your computer and use it in GitHub Desktop.
In local project folder:
git init
git add .
git commit -m "first"
On the server:
mkdir ~/repos/name-of-project.git
cd ~/repos/name-of-project.git
git init --bare
Create the hook:
pico ~/repos/name-of-project.git/hooks/post-update
GIT_WORK_TREE=~/path/to/site git checkout -f
chmod +x ~/repos/name-of-project.git/hooks/post-update
Local system:
git remote add website ssh://username@site.com/~/repos/name-of-project.git
git push -u website master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment