2

While trying to clone the project from GitLab I'm getting the below error:

Cloning into 'project Name'...
remote: HTTP Basic: Access denied
fatal: Authentication failed for 'project GitLab URL'

We tried the below command from this thread.

git config --system --unset credential.helper

After trying the above command, the Git CMD is asking to enter the username and password. We are able to enter the username but we were not able to enter the password.

Cloning into 'project Name'...
Username for 'https://gitlab.com': Name
Password for 'https://name@gitlab.com':
remote: HTTP Basic: Access denied
fatal: Authentication failed for 'project GitLab URL'

Also, we tried to remove the GitLab entry from the control panel like this blog. It also not solved the issue. Why I am not able to enter the password on GitLab?

Shreya
  • 37
  • 4
  • What was the command you used? Can you access the repo with your browser? – Christoph Oct 06 '20 at 16:09
  • @Christoph I have used the below command for cloning `git clone https GitLab Url of the project`. I am able to access the repo in the browser. – Shreya Oct 07 '20 at 05:36

1 Answers1

2

Too long for a comment: As decribed here, you can either

  • clone through HTTPS, use https://gitlab.com/gitlab-tests/sample-project.git.
  • or clone through SSH, use git@gitlab.com:gitlab-tests/sample-project.git.

As discribed in the autentifcation section,

  • If you want to use SSH to authenticate, follow the instructions on the SSH documentation to set it up before cloning.
  • If you want to use HTTPS, GitLab will request your user name and password:
    • If you have 2FA enabled for your account, you’ll have to use a Personal Access Token with read_repository or write_repository permissions instead of your account’s password. Create one before cloning.
    • If you don’t have 2FA enabled, use your account’s password.
Dharman
  • 21,838
  • 18
  • 57
  • 107
Christoph
  • 5,963
  • 3
  • 31
  • 73