Skip to content

Instantly share code, notes, and snippets.

@grahambates
Last active December 29, 2015 02:09
Show Gist options
  • Save grahambates/7598358 to your computer and use it in GitHub Desktop.
Save grahambates/7598358 to your computer and use it in GitHub Desktop.
Deploy with Git
## Create user for git:
As root:
useradd git-user
passwd git-user
chmod +xr /home/git-user/
## Create empty git repo:
As git user:
mkdir www
cd www
git init
Add the following to .git/hooks/post-receive:
#!/bin/sh
cd ..
GIT_DIR='.git'
umask 002 && git reset --hard
(Source: http://ryanflorence.com/deploying-websites-with-a-tiny-git-hook/)
chmod +x .git/hooks/post-receive
git config receive.denyCurrentBranch ignore
## Add new repo as additional remote on existing checkout
git remote add production [email protected]:www
git push production master
# /v1/rounds/:id/recipients/:userId
test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment