5/18/2013 - 6:46 AM

Run in LOCAL terminal...


# Replace this line with your real domain name

echo "-= Transferring changes to $DOMAIN =-"

# Clearing git env
unset GIT_DIR
cd ~/$DOMAIN
git pull

echo "-= Done =-"
# Replace any brackets with real values

# Before you start this, ensure that you have added shell (ssh) access for your hosted account (not just sftp/ftp).

# You may need to generate a new ssh key; if so, follow instructions to generate ssh key
ssh-keygen -t rsa

# Add to authorized keys on DREAMHOST
# For OSX:
cat ~/.ssh/ | ssh [user]@[host] "mkdir ~/.ssh; cat >> ~/.ssh/authorized_keys"
# Else:
ssh-copy-id [user]@[host]
# Replace any brackets with real values

# Try to ssh in to DREAMHOST (ensure it no longer asks for a PW); you may want to restart Terminal
ssh [user]@[host]
cd ~
mkdir [mydomain_com].git
cd [mydomain_com].git
git init --bare
vi hooks/post-receive
# Enter the code from the "post-receive" file (in this gist); save + quit 
cd ..
git clone [mydomain_com].git []

# Add remote to git's list of remote repos
cd [some local git folder]
git remote add live ssh://[user]@[host]/~/[mydomain_com].git

# Push to production :)
git push live master