Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Issue cloning GitHub private repo onto remote server

Note that this is the original article I've been following along with:
http://www.markdotto.com/2011/11/02/how-to-deploy-sites-via-github/

To give you a bit of background: We have a private repo set-up under an organisation account. We have three developers (myself included) who have our own accounts with GitHub and have administrator rights to the private repo.

While working on the project we clone the repo and then create a 'dev' branch. We each work from our own dev branch and push changes to the 'dev' branch on GitHub.

We want to get this dev branch onto our remote server so we can test the combined code works before merging it into our master branch (which should be clean/always deployable).

From here we're following the above article steps which is to connect to our server via SSH, go to the relevant directory where our website is hosted and run the following command...

git clone [email protected]:ORGANISATION/REPO.git dev

The first issue we had was our server returned the message...

Cloning into dev...
ssh: connect to host github.com port 22: Connection refused
fatal: The remote end hung up unexpectedly

...where I would have it expected it to ask us for a password?

So instead we tried the HTTP url...

git clone https://[email protected]/ORGANISATION/REPO.git dev

...you'll notice the HTTP url uses my own USERNAME now when cloning. I enter my password and it displays Cloning into dev... but then it displays the following error...

error: SSL certificate problem, verify that the CA cert is OK. Details:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed while accessing https://[email protected]/StormCreative/MoneyRepublic.com.git/info/refs
fatal: HTTP request failed

...I don't understand the error.

So how do we clone this private repo onto our server?

Any help appreciated!

Kind regards, Mark

like image 596
Integralist Avatar asked Mar 13 '12 13:03

Integralist


People also ask

Can a private GitHub repo be cloned?

Apr, 2022 Update: You can clone a private repository from your account and you can also clone a private repository from organization if you're its owner or member.

Why I Cannot clone a repository from GitHub?

If you're unable to clone a repository, check that: You can connect using HTTPS. For more information, see "HTTPS cloning errors." You have permission to access the repository you want to clone.

Why my git clone is not working?

This error occurs if the default branch of a repository has been deleted on GitHub.com. Detecting this error is simple; Git will warn you when you try to clone the repository: $ git clone https://github.com/USER/REPO.git # Clone a repo > Cloning into 'repo'... >


1 Answers

The first issue happens because you don't have the local rsa key linked to your account on GitHub (and yes, you link the rsa key to your account, and the organisation is linked to your account as well).

In the local machine (or remote server) where you are trying to clone the repository, you need to generate a rsa key:

ssh-keygen -t rsa

When you are generating the key, you chose a password and a place to store the id_rsa.pub file, that actually contains the key.

On GitHub, you need to add this key, the exact content of id_rsa.pub, to your ssh keys on your account administration panel.

like image 135
Daniel Ribeiro Avatar answered Sep 22 '22 20:09

Daniel Ribeiro