$ mkdir <repo-name>.git
$ cd <repo-name>.git
$ git init --bare$ mkdir /var/www/html
$ cat > hooks/post-receive
#!/bin/sh
GIT_WORK_TREE=/var/www/html git checkout -f
$ chmod +x hooks/post-receive$ ssh-add <path-to-ec2-ssh-key>.pem$ git remote add ec2 ssh://ec2-user@<amazon-server-address>/<repo-path.git>
$ git push ec2 +master:refs/heads/master