Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git: Unable to Clone Private Repositories, Error: Repositories not found

One of my friend added me on his Project on Github, as a collaborator. I am able to see the repo, but when I try to clone with this :

git clone https:/github.com/FriendsUserName/FriendsRepo.git

Gets errors:

remote: Repository not found.
fatal: repository https:/github.com/FriendsUserName/FriendsRepo.git not found

I have setup multiple Github account successfully, from this article - Github for work and play (multiple accounts)

Has anybody got this problem before?

I also tried to fork the repo and then clone. But still getting same error with clone.

like image 845
Rahul Sagore Avatar asked Jan 29 '16 08:01

Rahul Sagore


People also ask

Can private repositories be cloned?

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. *pat is PAT(Personal Access Token).

Why can I not clone a git repository?

If you see this error when cloning a repository, it means that the repository does not exist, you do not have permission to access it, or your GitHub Enterprise Server instance is in private mode.

How do I fix fatal repository not found?

Just run the git remote update command which updates the local repo with the remote repo and its credentials. If this command is executed without any issues then your issue will be resolved.


1 Answers

A little late to the party, but I got myself in the exact same situation as the asker, so maybe the way I managed to do it will help someone.

The tutorial referred in the question involves creating aliases for the different Github account, e.g. work.github.com for your work account and me.github.com for your personal one.

So, in this case, the way you should clone your repo should be (assuming it's for your personal account) :

git clone https:/me.github.com/FriendsUserName/FriendsRepo.git

However, even that didn't work for me.

What did work was using the alias together with the ssh url for cloning, i.e.

git clone [email protected]/FriendsUserName/FriendsRepo.git

If this still doesn't work, try to see that you are indeed connecting with the correct account :

ssh -T [email protected]

The response to that should be :

Hi <username for personal account here>! You've successfully authenticated, but GitHub does not provide shell access.

Good luck!

like image 185
AdelaN Avatar answered Oct 18 '22 08:10

AdelaN