Shreya
Shreya

Reputation: 67

Git CMD: Getting HTTP Basic: Access denied issue when trying to clone the project from GitLab

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://[email protected]':
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?

Upvotes: 3

Views: 8535

Answers (1)

Christoph
Christoph

Reputation: 7063

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 [email protected]: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.

Upvotes: 3

Related Questions