Unable to clone a git repo

2.7k Views Asked by At

I am trying to setup my build server (Windows 2008 machine) to build my project from github enterprise but I am getting Permission Denined (Public Key) when I try to clone a repo. I have generated ssh key and added it to github profile.

This is what I have when I try to test ssh connection and clone the repo.

D:>ssh -T [email protected]
Hi my_user! You've successfully authenticated, but GitHub does not provide shell access.

D:\>git clone [email protected]:myOrg/leaf.git
Cloning into 'leaf'...
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

I have tried this with both git bash and windows command prompt.

Please let me know if there is anything I am missing or if you need any more information.

2

There are 2 best solutions below

2
On

Github denies your access which means either SSH keys are not setup or public Key is not associated with the private key in the github.

  1. Try to generate the ssh key and add to the .ssh/ as id_rsa.pub in the github.

  2. Use https instead of ssh

0
On

try on Git Bash: $ git config --global -l

If the response is something as : http.proxy=http://:0 . Then you have to unset the http proxy server:

$ git config --global --unset http.proxy

now try cloning and it should go through