0

I created a github for my organization, which has multiple members. This repo has both private and public repositories which we all contribute to from our own github profiles. Meaning, I log in with MyName@github.com and the repositories are in Organization@github.com.

I am trying to clone one of the private repositories (through the command line) and I found the way to do that was with git clone git@github.com:username/repo.git but this is not working for me. I get the error fatal: The remote end hung up unexpectedly. So, since the repo is not on my profile, but the organizations' one, I am a little confuse as to how to access it.

Does anyone know how to clone this type of repo?

  • 1
    Are you admin for the organization account or have at least read access to the specific repo? As in, can you navigate to the repo in the browser while logged in? www.github.com// – TheIceBear May 24 '21 at 19:57
  • Yes, I am admin and I can get to the repo on the github website – GIOVANNI QUINONES VALDEZ May 24 '21 at 20:10
  • 1
    can you try `git clone https://github.com//.git`? And note that you `` is the name of the organization account. – TheIceBear May 24 '21 at 20:16
  • I get the same error `Permission denied (publickey). fatal: The remote end hung up unexpectedly` – GIOVANNI QUINONES VALDEZ May 24 '21 at 20:23
  • Can you `git clone` the public repositories from the organization account? – SwissCodeMen May 24 '21 at 20:32
  • hmm, when connecting over `https` there is no ssh keys involved and you should not get a `(publickey)` error (unless you have set that up specifcally). Have you connected to Github over ssh before? Have you set up a ssh key pair with GitHub? See more here: https://docs.github.com/en/github/authenticating-to-github/troubleshooting-ssh/error-permission-denied-publickey – TheIceBear May 24 '21 at 20:34
  • does this return the username of your individual account: `git config -l | grep user.name`? – TheIceBear May 24 '21 at 20:36
  • @SwissCodeMen Yes, I can clone the public ones – GIOVANNI QUINONES VALDEZ May 24 '21 at 20:55
  • @krikkan I don't get anything back – GIOVANNI QUINONES VALDEZ May 24 '21 at 20:56
  • @krikkan also, I havent connected to github thru ssh before. So should I set up a key pair first? – GIOVANNI QUINONES VALDEZ May 24 '21 at 20:57
  • 1
    You do not have to set up a key if you are using `git clone https://github.com//.git` instead of `git clone git@github.com:username/repo.git`, but somehow your client is trying to authenticate with keys anyways. One solution could be to try to set up keys. See my link above. Since the other command does not return your username that means that no authentication is stored in your config. If you do not want to try to set up a key, try to force git to set up your configuration using this answer: https://stackoverflow.com/a/35942890/6889416 – TheIceBear May 25 '21 at 02:20
  • `remote: Support for password authentication was removed on August 13, 2021. remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.` – ozanmuyes Dec 15 '22 at 01:12

0 Answers0