繁体   English   中英

无法从 gitlab 将 ssh/https 克隆到我的 mac

[英]Cant clone ssh/https to my mac from gitlab

我在向 GitLab 推送/拉取更改时遇到问题,因此我决定删除 mac 上的 git 存储库。

但是,现在它不会让我再次克隆该项目。
我遇到了各种错误消息,并尝试了所有方法来解决问题,但没有成功。 我无法使用 SSH 或 HHTPS 进行克隆。

我现在删除了我的 ssh-key 并制作了一个新的(我认为)我已经连接到 GitLab。

我将提供图片和文字以及我收到的错误消息:

https://i.stack.imgur.com/J39g0.png

marcus@Marcuss-MacBook-Pro-2 cd .git
marcus@Marcuss-MacBook-Pro-2 .git % git clone git@gitlab.stud.idi.ntnu.no:marcuslj/rentadog-git 
Cloning into 'rentadog'... 
ssh: connect to host gitlab.stud.idi.ntnu.no port 22: Operation timed out
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

marcus@Marcuss-MacBook-Pro-2 .git git clone https://gitlab.stud.idi.ntnu.no/marcuslj/rentadog.git 
Cloning into 'rentadog'...
Username for 'https://gitlab.stud.idi.ntnu.no: marcuslj
Password for 'https://marcuslj@gitlab.stud.idi.ntnu.no
remote: HTTP Basic: Access denied. The provided password or token is incorrect or your account has 2FA enabled and you must use a personal access token instead of a password. See https://gitlab.stud.idi.ntnu.no/help/topics/git/troubleshooting.git#error-on-git-fetch-http-basic-access-denied
fatal: Authentication failed for 'https://gitlab.stud.idi.ntnu.no/marcuslj/rentadog.git/'
marcus@Marcuss-MacBook-Pro-2 git %

如您所见,我首先尝试使用 SSH,然后尝试使用 HTTPS。 它们都不起作用。 已经分散在整个 inte.net 上尝试找到解决方案,但没有运气。

现在我只想完全重新安装 git,我也尝试过但没能做到...

所以无论如何,如果有人能帮助我,那就太好了。

虽然您可能有网络/防火墙问题阻止您使用 SSH,但 HTTPS 应该可以工作。

确保创建一个PAT(个人访问令牌) ,并将其用作密码。

当你这样做时,确保安装了GCM(Git 凭据管理器) :这将帮助你缓存你的凭据(用户名/令牌)。
这样,您就不必在每次推送时再次重新输入它们。

暂无
暂无

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

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