使用 git clone 时如何修复“找不到您要查找的项目”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/54571213/
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-19 13:15:57  来源:igfitidea点击:

How to fix 'The project you were looking for could not be found' when using git clone

gitgitlabprojectgit-bashcloning

提问by tijnster

I am trying to clone a project from gitlab to my local machine. I have been granted rights as a developer, and use the command 'git clone

我正在尝试将一个项目从 gitlab 克隆到我的本地机器。我已被授予开发人员权限,并使用命令 'git clone

  • None of the protocols work (ssh and https neither work)
  • 没有任何协议有效(ssh 和 https 都无效)

The error message I am getting:

我收到的错误消息:

remote: The project you were looking for could not be found. fatal: repository 'https://gitlab.com/KZA_Connected/skilltree.git/' not found

远程:找不到您要查找的项目。致命:未找到存储库“ https://gitlab.com/KZA_Connected/skilltree.git/

Any help would be highly appreciated.

任何帮助将不胜感激。

回答by Abdul Karim Khan

I solved this by simply adding username to url like below,

我通过简单地将用户名添加到 url 解决了这个问题,如下所示,

before: https://gitlab.com/gitlab_user/myrepo.git

之前:https: //gitlab.com/gitlab_user/myrepo.git

after: https://[email protected]/gitlab_user/myrepo.git

之后: https://[email protected]/gitlab_user/myrepo.git

回答by Abdul Waheed

Today, I was having the same issue. The repo was working fine at my home machine, but when I tried the same repo in other machine I started facing the same error. I was using below URL

今天,我遇到了同样的问题。回购在我的家用机器上运行良好,但是当我在其他机器上尝试相同的回购时,我开始面临同样的错误。我正在使用以下网址

https://gitlab.com/{gitlab_user}/project_repo.git

And now I changed above URL to below

现在我将上面的 URL 更改为下面

https://{gitlab_user}@gitlab.com/gitlab_user/project_repo.git

And it worked for me. Above solution was found at below URL

它对我有用。在以下 URL 中找到了上述解决方案

https://medium.com/@imstudio/gitlab-the-project-you-were-looking-for-could-not-be-found-issue-685944aa5485

Hope this helps other.

希望这对其他人有帮助。

回答by Shini_TheCreator

I honestly don't know how GitLab works, I use GitHub, but check if the repo is marked as private.

老实说,我不知道 GitLab 是如何工作的,我使用 GitHub,但请检查该存储库是否标记为私有。

I had similar issue on GitHub where my friend couldnt retrieve and clone my repo even though he had a status of "Contributor" cz I accidentaly checked it to be Private. Also check if your GitLab account and one you are using in your Command line tool is matching.

我在 GitHub 上遇到了类似的问题,我的朋友无法检索和克隆我的 repo,即使他的状态为“贡献者”,因为我不小心将其检查为私有。还要检查您的 GitLab 帐户和您在命令行工具中使用的帐户是否匹配。

回答by tijnster

Solution: it was due my windows credentials being set to an other email account.

解决方案:这是由于我的 Windows 凭据被设置为其他电子邮件帐户。