git --work-tree=/var/www/momentun --git-dir=/var/repo/sitemomentun.git checkout -f
Get a local git repo up on an EC2 Instance.
Add yourself to the ssh auth agent, if you haven't already.
ssh-add path/to/your/EC2.pem
SSH into the remote directory, and create a barebones remote repo directory.
ssh ec2Username@long-crazy-amazon-ip.com
mkdir repo-name.git && cd repo-name.git
git init --bare
cd repo-name
git init git add .
git commit -m "Initial git commit message"
git remote add origin ec2Username@long-crazy-amazon-ip.com:/path/to/your/repo-name.git
git config --global remote.origin.receivepack "git receive-pack" # needed for aws ec2 stuff.
git push origin master
The origin url can be used for cloning too.
git clone ec2Username@long-crazy-amazon-ip.com:/path/to/your/repo-name.git
(This guide was lifted from here, then modified slightly.)