[英]Cant clone ssh/https to my mac from gitlab
我在向 GitLab 推送/拉取更改時遇到問題,因此我決定刪除 mac 上的 git 存儲庫。
但是,現在它不會讓我再次克隆該項目。
我遇到了各種錯誤消息,並嘗試了所有方法來解決問題,但沒有成功。 我無法使用 SSH 或 HHTPS 進行克隆。
我現在刪除了我的 ssh-key 並制作了一個新的(我認為)我已經連接到 GitLab。
我將提供圖片和文字以及我收到的錯誤消息:
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.