Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I clone Github data to Amazon EC2?

I am new to both Git and Amazon EC2.

I want to clone my Github code to Amazon EC2 directly.

For that I have referred to the following URLs:

http://thelucid.com/2008/12/02/git-setting-up-a-remote-repository-and-doing-an-initial-push/

http://deductiveblog.in/2013/05/19/deploy-to-amazon-ec2-using-git/

How to push to git on EC2

I've performed the necessary changes suggested in the above URLs, but am still not able to get my data on Amazon EC2.

By following the above suggested steps, I can see one directory - but it does not display the data in it that I have in git & in my local.

So what should I do to clone all data in Amazon EC2?

I also want to know one other thing - is it possible that I can put my files directly in /var/www directory without creating .git?

Now in this, I am getting an error Permission denied (publickey). Fatal the remote end hung up unexpectedly.

For that I have checked my ssh keys as well and add it to github. I have a file authorized_keys for key and I have added the same key in github, but still it gives me a Permission denied error.

Can anyone give any suggestions how to resolve this?

like image 689
Stan Avatar asked Aug 18 '26 14:08

Stan


1 Answers

You can just use the git clone command from your ec2 instance from the directory you want the repo cloned to.

git clone git://github.com/ryanb/railscasts-episodes.git

of course you need to alter the url part to your repo, this will create a folder with the files inside named after the repo in the current directory. If you want to clone the files inside the repo into the current directory do:

git clone git://github.com/ryanb/railscasts-episodes.git .

The Full Stop (.) or dot indicates the current directory in Unix.

like image 175
jeremyjjbrown Avatar answered Aug 20 '26 04:08

jeremyjjbrown



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!