直到最近,我还能够通过SSH推送到GitLab。我们更改了一些配置,所以我在解决问题时遇到了问题。最大的变化是我现在使用VPN,项目更改了所有者,IP受到限制。我觉得这与知识产权限制有关。
ssh -T git@gitlab.com
打印Welcome to GitLab, @myUsername!
,因此ssh连接正在工作。
然而,如果我尝试克隆、推送等,它会失败,并出现各种错误(添加到下面(,但最终会显示Please make sure you have the correct access rights and the repository exists
。
我尝试了各种方法(添加到下面(,主要是根据我找到的其他答案修改遥控器,使其以各种身份使用我的用户名。它们都不起作用我可以通过https://strong>推送/克隆。
我需要在gitlab中设置一个IP或其他配置吗?
我尝试过的一些东西:
git remote add origin git@myUsername.gitlab.com:companyName/projectName.git
git remote add origin git@gitlab.com:companyName/projectName.git
git remote add origin myUsername@gitlab.com:companyName/projectName.git
及其相应的错误:
ssh: Could not resolve hostname myUsername.gitlab.com: Name or service not known
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
remote:
remote: ========================================================================
remote:
remote: The project you were looking for could not be found.
remote:
remote: ========================================================================
remote:
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
myUsername@gitlab.com: Permission denied (publickey,keyboard-interactive).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
建议:
- 仔细检查存储库的配置:https://docs.gitlab.com/ee/ssh/README.html#testing-一切都设置正确
- 为HTTPS身份验证配置存储库https://forum.gitlab.com/t/could-not-read-from-remote-repository-from-gitlab-com/7508/2
- 启用GitLab详细日志记录:docs.GitLab.com/ee/administration/logs.html