简体   繁体   中英

Cant clone ssh/https to my mac from gitlab

I have had an issue with pushing/pulling changes to GitLab, so I decided to remove the git repository on my mac.

However, now it wont let me clone the project again.
I am met with various error messages and have tried everything to fix the problem, with no luck. I cant clone with either SSH or HHTPS.

I have now deleted my ssh-key and made a new one (I think) that I have connected to GitLab.

I will provide a picture and text with the error messages I get:

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 %

I first try with SSH, then HTTPS as you can see. None of them work. Have already scattered all over the inte.net to try and find a solution, with no luck.

Now I am at the point where I just want to reinstall git completely, which I have also tried and didn't manage to do...

So anyways, if anyone could help me, that would be great.

While you might have a.network/firewall issue preventing you to use SSH, HTTPS should work.

Make sure to create a PAT (Personal Access Token) , and use that as a password.

While you are at it, make sure the GCM (Git Credential Manager) is installed: that will help you to cache your credentials (username/token).
That way, you won't have to re-enter them again on each push.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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