Put your ssh key on the server:
$ ssh-copy-id [email protected]
On the server, create a bare git repo:
$ mkdir website.git
$ cd website.git
$ git init --bare
On the local machine, add the server repo as a remote host:
$ git remote add production ssh://[email protected]/~/git/website.git
Finally, add the post-receive
script attached to this Gist.
Now you can push to your new production repo:
$ git push production master
References: