简体   繁体   English

git:无法克隆私有存储库,错误:找不到存储库

[英]git: Unable to Clone Private Repositories, Error: Repositories not found

One of my friend added me on his Project on Github, as a collaborator. 我的一位朋友加入了他作为合作者的Github项目。 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) 我已经成功设置了多个Github帐户,从这篇文章 - Github工作和娱乐(多个帐户)

Has anybody got this problem before? 以前有人遇到过这个问题吗?

I also tried to fork the repo and then clone. 我也尝试分叉回购然后克隆。 But still getting same error with clone. 但仍然与克隆相同的错误。

The error might occur in the permissions. 权限中可能会发生错误。 Check if you have the permission to access. 检查您是否有权访问。

Your friend must change the permisssion how this article: https://help.github.com/articles/adding-collaborators-to-a-personal-repository/ 您的朋友必须更改本文的内容: https ://help.github.com/articles/adding-collaborators-to-a-personal-repository/

Also check your ssh access for validate if you re authenticated successfully for rule options ;) 如果您成功通过规则选项验证,请检查您的ssh访问以进行验证;)

ssh -T git@github.com ssh -T git@github.com

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, eg work.github.com for your work account and me.github.com for your personal one. 问题所指的教程包括创建了不同的Github上的帐户,如别名work.github.com为您的工作账号和me.github.com为您的个人之一。

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, ie 什么工作使用别名和ssh网址进行克隆,即

git clone git@me.github.com/FriendsUserName/FriendsRepo.git

If this still doesn't work, try to see that you are indeed connecting with the correct account : 如果仍然无效,请尝试查看您确实正在使用正确的帐户:

ssh -T git@me.github.com

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! 祝好运!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM