Loving Open-Souce One Anonymous Function at a Time.

Deploying with Git

I want to deploy new code to using a simple command like

git push stage master


git push prod master

On the server, make a new git repository

git init

Edit the config file inside of .git/

    repositoryformatversion = 0
    filemode = true
    bare = false
    logallrefupdates = true

    denyCurrentBranch = ignore

Make a post-receive hook with these commands

cd .. 
umask 002 && git reset --hard

Make that hook exacutable

chmod +x post-receive

On your machine (not the server)

Add the a new git remote, I edited my local copy and duplicated what I had setup for origin