How to set up remote GIT on Amazon AWS?

Asked

Viewed 404 times

1

I made an account on AWS and I’m having trouble organizing and configuring repository files with GIT.

I already have APACHE, PHP, MYSQL, and GIT installed. I created a /var/git folder to organize repositories, and subfolders for each client: git/cliente1/

I initialized the repository with "git --Bare init" within /git/cliente1/cliente1.git

I initialized git locally in client folders on my pc (git init) and added the remote git "git remote add origin usuario@server/client/cliente1.git"

However, when I give "git push origin master" it tells me that the public key is invalid (permission denied - public key)

I tried to set up the public key but I was unsuccessful. You can help me?

1 answer

1


You need to create the repositories locally, commit the files, upload to the remote repository and only then clone them in your AWS instance.

First of all, create remote repositories in your service of choice (Github, Bitbucket etc).

Then, in order for you to send your local repositories to your corresponding remote repositories, you need to create a key pair (being a public and private) and then do the commit and then the push.

Anyway, you can clone the repositories in your AWS instance. You can do so using the same private/public keys, or using deploy Keys. The difference is that a deploy key gives you access to a single repository, while private/public keys give you access to all of your user’s repositories. Goes from your own need.

  • Thanks for the answer, Rodrigo. Yes, I created the remote repositories, then I created the local repositories, added them, comitei. But my problem seems to be logging public keys inside the AWS server. In this link you put, the example is with bitbucket or github, there have their own sites, it is quiet. But on Amazon, I’m a little lost where I insert the keys to authenticate myself.

  • You do not need to enter key anywhere. Just generate it within the instance using the command ssh-keygen, copy the public key that will be saved (by default) in the file ~/.ssh/id_rsa.pub and set it up in your Git service profile, the same way you set up your personal key.

  • And then, he managed to solve?

Browser other questions tagged

You are not signed in. Login or sign up in order to post.