2

Since the update of TortoiseGit from 2.6.0.0 to 2.7.0.0 I cannot access my GitLab anymore through use of TortoiseGit. I managed to fetch, pull and push on 2.6, but as of today with 2.7 this does not work. I have two computers with exactly the same settings, one still on 2.6 and another on 2.7. The 2.7 version provides me the error

remote: HTTP Basic: Access denied
fatal: Authentication failed for 'https://gitlab.com/company/NL/projects/name.git/'

This is exactly the same error as mentioned here. But, I tried all of the options displayed there too, with none of them working. I keep getting the "Git Credential Manager for Windows" popup, where I provide my username and password that work for logging in to GitLab and work on the other computer, but I still get the authentication failed. using wincred does not work either.

Looking at the working computer, I do see a git:https://gitlab.com credential in the "Generic Credentials" category of the windows credential manager. A credential similar to this does not show up at the 'failing' computer. Manually adding my credentials there stops the Git Credential Manager for Windows from appearing, however, still results in the access denied error.

Other items that might assist:

  • I have removed TortoiseGit 2.7 and installed 2.6 (yet this did not solve the issue)
  • I have removed and reinstalled TortoiseGit 2.7
  • I have updated Git to the latest version (2.18.0 as of 22/08/2018)
  • SSH or 2FA is not enabled
  • git config credential.helper is set to 'manager'

Of course my key question remains: how do I access my remote repository again through git?

MrTux
  • 32,350
  • 30
  • 109
  • 146
DoubleYou
  • 1,057
  • 11
  • 25

3 Answers3

5

I just saw this with a colleague of mine. He also did not have 2FA enabled, yet GitLab was expecting him to provide a Personal Access Token instead of a password, in the Windows Credentials popup.

Check out the link to see how to generate that token, and then just provide the credentials popup with:

  • Username: your GitLab username
  • Password: this token you generated

Also, as an aside, if Windows stops asking you for your credentials, you should be able to go into the "Credential Manager" from Control Panel, and then find and delete your (erroneous) stored GitLab credentials.

Joe
  • 981
  • 3
  • 9
  • 21
  • Providing credit where credit is due, here is where I found the answer above: [Unable to use git over https -> remote: HTTP Basic: Access denied](https://gitlab.com/gitlab-org/gitlab-ce/issues/21246#note_14343630) – Joe Sep 19 '18 at 19:52
1

In the end, it turns out there was a complete different situation causing this (confusing) error. It was not related to the update of TortoiseGit, but to an update of the company's web access control system. As all traffic is run through a company proxy, the site gitlab.com using TortoiseGit was blocked (while the site itself was accessible through a browser).

As TortoiseGit could not successfully establish a connection, probably TortoiseGit 'assumed' this was an authentication error.

For anyone else coming across this error and nothing online worked, check to disable your corporate site connection limiter (our company uses the Blue Coat Unified Agent) and try again.

DoubleYou
  • 1,057
  • 11
  • 25
1

Situation:

  • In my case, if you have enabled 2FA in Gitlab then you take pull or fetch source by tortoise git, will get message error: Basic Access denied.

Solution:

  • At first, you need to create access token in gitlab. You can visit this link: GitLab remote: HTTP Basic: Access denied and fatal Authentication

  • After creating access token, you need set access token in tortoise git:

  • Access Settings of Tortoise Git

  • In left panel, you choose Git category => Remote item => In right panel, in Remote Box, choose origin.

  • You can see URL input which has format: https://oauth2:your_access_token@gitlab.com/your_repository.

  • In URL input, you need replace your_access_token with new access token which you created in gitlab.

  • Finally you click Apply button => OK button.

  • Hope, it will be useful for someone.

[Config access token in url in Git][1] [1]: https://i.stack.imgur.com/QZGBQ.png

nguyen
  • 41
  • 4