GIT Fatal error: Authentication failed in Visual Studio

前端 未结 5 434
南旧
南旧 2021-01-12 00:43

As of today I\'m getting errors when trying to use git commands with my repository in Azure-DevOps. The repositories sit in a project on DevOps that I can access with the sa

相关标签:
5条回答
  • 2021-01-12 00:50

    I had a similar problem in VS2019, I moved laptops and it refused to authenticate despite me deleting and changing the credentials using credentials manager. I'm linked to a repository in Assembla and In the team explorer window under repository settings I noticed that there's a tick box to override the global user name and email settings, which were different from my Assembla login.

    0 讨论(0)
  • 2021-01-12 00:55

    Try and check the value of git config credential.helper.

    If you see "manager", open the Windows Credentials Manager, and put as a password the PAT -- the Personal Access Token created -- (while keeping your regular login, associated to the remote URL)

    Then try again, and see if the issue persists.

    0 讨论(0)
  • 2021-01-12 01:02

    In my particular case after many mails back and forth with Microsoft it turned out that two of my accounts somehow started conflicting with eachother causing weird errors. A nice example was that making changes to a wiki in DevOps would show a different account in the commit trial than the account I was logged into.

    In the end Microsoft managed to fix it and I haven't had any issues since.

    0 讨论(0)
  • 2021-01-12 01:10

    To force the Git credential Manager to stop interfering, you can add the following to your global git config:

    [credential]
        helper = 
    

    This effectively turns off any credential manager. In Azure DevOps you can then configure a set of Git Credentials or a Personal Access Token and use that to connect directly.

    It doesn't explain the problems you're experiencing. Given that your account seems to be Machine Bound and an AAD account a lot of things can be in play. This includes AAD Home-Realm Discovery and Single Sign-on and Azure Active Directory Guest accounts.

    Another possible problem is your Windows Credential Store which has multiple locations where Azure DevOps and Git credentials are stored. And finally the account used to sign-in to Visual Studio 2019 to retrieve its license may be playing up.

    With the information you've provided it's neigh impossible for us to help you resolve the issues without looking over your shoulder. I'd almost suggest filing an Azure support request if you have them available so an engineer can look with you.

    Optionally run

    git-credential-manager.exe erase
    

    And pass in the following data

    protocol=https
    host=dev.azure.com
    path=/jessehouwing/vsts-extensions/_git/vsts-github-tasks
    {newline}
    

    To tell git to delete the credentials stored for your account

    0 讨论(0)
  • 2021-01-12 01:10

    I had the same situation - everything worked in VS 2017, but 2019 would not work. I found this article, which suggested I update the Git Credential Manager for Windows. My installed version (at C:\Program Files\Git\mingw64\libexec\git-core\git-credential-manager.exe) was 3 years old. Downloaded, installed, and the problem went away for me.

    0 讨论(0)
提交回复
热议问题