Before begining, make sure your SSH keys are set so you can ssh
to your Dreamhost account.
Mac
$ ssh-copy-id -i ~/.ssh/id_rsa.pub username@domain.com
$ ssh username@domain.com
Windows
$ scp ~/.ssh/id_rsa.pub [user]@[hostname]:~/.ssh/authorized_keys
$ ssh username@domain.com
You now need to make a git repository for that site (at the same level in the tree) and initialize a bare repo:
$ mkdir domain.com # if necessary
$ mkdir domain.com.git
$ cd !$
$ git init --bare
Now you need to create a hook that will, upon a push, copy the contents of the updated repository to the website directory:
$ vi hooks/post-receive (then add the following line)
git --work-tree=/home/username/domain.com --git-dir=/home/username/domain.com.git checkout -f
$ chmod +x hooks/post-receive
$ exit
Now, back on your development machine, in the original git repo, add Dreamhost as a remote that will ALSO get pushed to when you push your updates:
$ git remote add prod ssh://username@domain.com/home/username/domain.com.git
$ git push prod +master:refs/heads/master # only need to do once: force push
From now on, push as usual:
$ git push prod master
This is the reference post