git clone - 致命:远程错误:访问被拒绝或存储库未导出

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10285198/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 13:32:10  来源:igfitidea点击:

git clone - fatal: remote error: access denied or repository not exported

gitgithubgithub-for-mac

提问by underscore666

When I try to perform the following command, git clone git://github.com/mainDir/dirA, I get the following error:

当我尝试执行以下命令时,git clone git://github.com/mainDir/dirA出现以下错误:

> git clone git://github.com/mainDir/dirA
Cloning into 'dirA'...
fatal: remote error: access denied or repository not exported: /8/nw/87/1e/aa/2154553/2154553.git

git://github.com/mainDiris a private repository

git://github.com/mainDir是一个 private repository

If I try to use github for the mac... I see the message Cannot find repository.

如果我尝试在 Mac 上使用 github...我会看到消息Cannot find repository

For sure the problem is in my desktop (client part) because I know how to reproduce the problem:

肯定问题出在我的桌面(客户端部分),因为我知道如何重现问题:

1) git clone repoon my desktop (it works)
2) rm -rf repo
3) git clone repoand I get the error

1)git clone repo在我的桌面上(它可以工作)
2)rm -rf repo
3)git clone repo我收到错误

How can I fix this problem?

我该如何解决这个问题?

回答by ngm

Is it actually a private repository? If so, I don't believe that

它实际上是一个私人存储库吗?如果是这样,我不相信

git clone git://github.com/mainDir/dirA

will work. Try

将工作。尝试

git clone [email protected]:mainDir/dirA

From github help:

github 帮助

For public repos, the URL can be a read-only URL like git://github.com/user/repo.git or an HTTP read-only URL like http://github.com/user/repo.git. For public repos you own or are a collaborator on, and all private repos, you must use a private ssh url like [email protected]:user/repo.git.

对于公共存储库,URL 可以是只读 URL,如 git://github.com/user/repo.git 或 HTTP 只读 URL,如http://github.com/user/repo.git。对于您拥有或合作者的公共存储库,以及所有私有存储库,您必须使用私有 ssh url,如 [email protected]:user/repo.git。

回答by Ana

Just try using:

尝试使用:

git clone http://github.com/mainDir/dirA

or

或者

git clone https://github.com/mainDir/dirA

回答by webKnjaZ

Today this happened to me today when I removed my fork of a certain repo, which was detached from the upstream network a day before. And then I re-forked the upstream under the same account.

今天这发生在我身上,当时我删除了某个 repo 的 fork,该 repo 是前一天从上游网络分离的。然后我在同一个帐户下重新分叉了上游。

First, it was showing me

首先,它向我展示

Forking org_name/repo_name
It should only take a few seconds.

longer than usual.

比平时长。

Then, it got stuck with

然后,它卡住了

This repository is temporarily unavailable.
The backend storage is temporarily offline. Usually this means the storage server is undergoing maintenance. Please contact support if the problem persists.

Check our status site for updates

on the forked repo page.

在分叉回购页面上。

So I removed it after a while, waited a few hours and forked again.

所以我过了一会儿把它取下来,等了几个小时,又分叉了。

I think, this is some race condition happening because of GitHub's eventual consistency.

我认为,这是由于 GitHub 的最终一致性而发生的一些竞争条件。

回答by Oleg Kokorin

it's a different problem for real:

这是一个不同的问题:

git clone git://github.com/mainDir/dirA

git clone git://github.com/mainDir/dirA

looks more like an attempt to clone only subfolder of the mainDirrepository and GIT refuse this functionality for a reason to save the repository integrity. so clone instead:

看起来更像是试图只克隆mainDir存储库的子文件夹,而 GIT 出于保存存储库完整性的原因拒绝了此功能。所以克隆:

git clone git://github.com/mainDir

git clone git://github.com/mainDir

then look for the subfolder required

然后查找所需的子文件夹