Last active
December 29, 2015 02:09
-
-
Save grahambates/7598358 to your computer and use it in GitHub Desktop.
Deploy with Git
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## 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