I'm working with Visual Studio and am trying to clone a online repo from a server where gitlab is running. Let's call the server https://gitlab.example.com
I get the following error when I try to clone the repo
Remote: HTTP Basic: Access denied
Error encountered while cloning the remote repository: Git failed with a fatal error.
Authentication failed for 'https://gitlab.example.com/username/test.git/'
When I try it, I get promted to enter a username and password for the server. I entered the user credentials of the user which created the repo.
I've found a similar problem with an answer here on stackoverflow, but this didn't work for me.
I am using Visual Studio 2017 Enterprise 15.7.2
Head over to the Git website and install the latest version of Git for Windows. Go back into the Visual Studio installer and tick "Git for Windows" again. It will not download a new version even though it may look like it is. After that is done, your Git should be fine with VSTS and TF Explorer.
Open Visual Studio. On the start window, select Clone a repository. Enter or type the repository location, and then select the Clone button. You might be asked for your user sign-in information in the Git User Information dialog box.
Windows must have saved your git credentials which needs to be updated/remove. Below steps worked for me in VS2017.
Go to "Credential Manager" from Windows "Start" and under "Generic Credentials" select your git url. Click on the right side arrow, it should expand and you should see two links "Edit" & "Remove from vault".
Click on latter link (recommendable), restart VS, open your project & do a sync/pull request, it should ask your credentials to enter and you should be good to go. Thanks
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With