4

I'm trying to clone an empty repository from my Gitlab account. I simply use the address shown on my Gitlab repository page under SSH:

git@gitlab.xxx.com:USERNAME/project-name.git

enter image description here

Then simply try this in an empty folder, but it keeps telling me permission denided, asking for retry:

git clone git@gitlab.xxx.com:USERNAME/project-name.git
Cloning into 'project-name'...
git@gitlab.xxx.com's password:
Permission denied, please try again.
git@gitlab.xxx.com's password:

and when I choose the https address for clone, this is the message:

remote: HTTP Basic: Access denied
fatal: Authentication failed for ....

I am able to login to Gitlab homepage with that password, so I don't know what is really wrong.

What is wrong? How to fix it?

phd
  • 57,284
  • 10
  • 68
  • 103
Tina J
  • 3,411
  • 8
  • 39
  • 93
  • You are missing a SSH key here – gogaz Nov 14 '18 at 15:54
  • ummm, what is the solution?! – Tina J Nov 14 '18 at 15:55
  • `git clone http://gitlab.xxx.com/project-name.git` will ask for user and password – Joao Vitorino Nov 14 '18 at 16:22
  • Possible duplicate of [GitHub Error Message - Permission denied (publickey)](https://stackoverflow.com/questions/12940626/github-error-message-permission-denied-publickey) – phd Nov 14 '18 at 16:54
  • https://stackoverflow.com/search?q=%5Bgit%5D+ssh+authentication – phd Nov 14 '18 at 16:54
  • Possible duplicate of [GitLab remote: HTTP Basic: Access denied and fatal Authentication](https://stackoverflow.com/questions/47860772/gitlab-remote-http-basic-access-denied-and-fatal-authentication) – mpro Nov 15 '18 at 06:43

2 Answers2

2

ssh authentication on Gitlab requires a ssh key. You need to generate one, depending on your host, windows, linux or other. Then you need to add the key to your account.

You can find all the required information here: https://gitlab.com/help/ssh/README.md

If you want to use your http login you should switch to http authentication. At the left of the repository address there's a menu, you can choose ssh or http. Use the latter

ErniBrown
  • 984
  • 10
  • 21
  • Still not working: `remote: HTTP Basic: Access denied fatal: Authentication failed for ....` – Tina J Nov 14 '18 at 16:12
  • 1
    @TinaJ maybe [this](https://stackoverflow.com/questions/47860772/gitlab-remote-http-basic-access-denied-and-fatal-authentication) helps? – ErniBrown Nov 14 '18 at 16:27
2

As I'm in Windows, this answer was the life saver:

It happen every time I'm forced to change the Windows password and none of above answers helped to me.

Try below solution which works for me:

Go to Windows Credential Manager (press Windows Key and type credential) to edit the git entry under Windows Credentials. Replace old password with the new one.

Tina J
  • 3,411
  • 8
  • 39
  • 93