Created
May 22, 2016 17:48
-
-
Save matthewoden/b29353e266c554e04be8ea2058bcc2a0 to your computer and use it in GitHub Desktop.
Revisions
-
matthewoden created this gist
May 22, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,34 @@ # AWS Remote Git Setup Get a local git repo up on an EC2 Instance. ## Add youself to SSH Authentication: Add yourself to the ssh auth agent, if you haven't already. ```bash ssh-add path/to/your/EC2.pem ``` ## Set up destination directory: SSH into the remote directory, and create a barebones remote repo directory. ```bash ssh [email protected] mkdir repo-name.git && cd repo-name.git git init --bare ``` ## Set up your local to push to our new remote: ```bash cd repo-name git init git add . git commit -m "Initial git commit message" git remote add origin [email protected]:/path/to/your/repo-name.git git config --global remote.origin.receivepack "git receive-pack" # needed for aws ec2 stuff. git push origin master ``` ## Cloning repository The origin url can be used for cloning too. ```bash git clone [email protected]:/path/to/your/repo-name.git ``` (This guide was lifted from [here](https://shirtdev.wordpress.com/2011/05/04/setting-up-a-git-repository-on-an-amazon-ec2-instance/), then modified slightly.)