Skip to content

Instantly share code, notes, and snippets.

@mattholl
Created July 17, 2012 16:06
Show Gist options
  • Save mattholl/3130315 to your computer and use it in GitHub Desktop.
Save mattholl/3130315 to your computer and use it in GitHub Desktop.
basic git deploy
http://toroid.org/ams/git-website-howto
SET UP BARE REMOTE
1. set up local repo
2. on remote mkdir eg repos/website.git
3. in website.git - git init --bare
4. mkdir to be served from eg sites/website.co.uk
5. in website.git edit hooks/post-receive
#!/bin/sh
GIT_WORK_TREE=/sites/website.co.uk git checkout -f
6. make executable chmod +x hooks/post-receive
7. on local repo
git remote add origin ssh://[email protected]:[port number]/full/path/to/site/website.git
git remote add origin ssh://server-name/home/user/repo.git
git push origin +master:refs/heads/master
git push origin dev:master
dev:master = refspec = local_branch:remote_branch
8. henceforth git push origin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment