4

I have an Azure DevOps account that I'm trying to use to host git repos. The problem is that when I add remote origin then try to git push -u origin --all I'm prompted for a password, but the account's password results with: fatal: Authentication failed for...

Is there a different password you have to set up or something diffierent that needs configured to be able to access Azure DevOps Repos? I couldn't find a decent explanation as to why your account password fails or how to set another password that'll be accepted. Thanks for any tips or advice!

CoderLee
  • 3,079
  • 3
  • 25
  • 57
  • If you go to the Azure website (the Git Server), are you able to see (or create) a repository? Using the same credentials. – Khalil Khalaf Jan 14 '20 at 01:13
  • Have you tried https://stackoverflow.com/questions/35834117/git-error-fatal-authentication-failed? Seems this problem can be caused by multi reasons and one of the solution is to edit user information at Windows Credentials, another is to install GCM:https://github.com/Microsoft/Git-Credential-Manager-for-Windows#download-and-install. – mbb5079 Jan 14 '20 at 01:45
  • @YS5079 Unfortunately that's no good, I'm using a MacBook Pro so windows specific solutions won't help much. Thanks for the suggestion. – CoderLee Jan 14 '20 at 01:47
  • Hi @CoderLee, in fact the GCM also has a version for mac and linux: https://github.com/Microsoft/Git-Credential-Manager-for-Mac-and-Linux#git-credential-manager-for-mac-and-linux you can have a try following the steps. – mbb5079 Jan 14 '20 at 02:34
  • @YS5079 that's great, didn't realize they had that. Thanks! – CoderLee Jan 14 '20 at 02:39
  • It will be great if we can hear the latest state of your problem. Has it been solved? Maybe you can share us how you solve the problem. Or if it's not, please feel free to share the latest situation. – mbb5079 Jan 21 '20 at 08:31
  • @mbb5079 see my answer for latest state, thanks – CoderLee Feb 05 '20 at 16:09

3 Answers3

3

Ultimately I had to remove my first repo, then create a new one with the same name before being able to gain proper access. I have had zero issues with creating/updating/deleting repos afterwards.

It was solely the initial repo that was not working. Could've been an edge case, but if you find that the suggested steps aren't allowing you to access your azure repo, then try removing and recreating it.

note: The Create a new Git repo in your project page on MSDN's Azure section was rather helpful for this and other issues you may come across.

CoderLee
  • 3,079
  • 3
  • 25
  • 57
  • Strange, I wonder what was in that first repository which would cause such an issue? – VonC Feb 05 '20 at 16:20
  • @VonC same question here, it was literally a "Create Repo" -> add remote origin -> fail constantly on any type of connection attempt. Delete repo, repeat steps, and now it works??? Doesn't make sense, but at least it works. – CoderLee Feb 05 '20 at 16:24
2

Check if you have a credential helper setup: git config credential.helper.

If your remote URL is an HTTPS one, the wrong credentials might have been cached.

If so, see "Updating credentials from the OSX Keychain": git credential-osxkeychain erase https://<azure domain>

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
2

Try logging into the Azure DevOps Website on the machine that the git repo lives on.

My scenario is that I was using Git on a different system than I use for the Azure DevOps UI. It randomly started giving me a bunch of 403's and the credential-manager login popup printed "failed to find location service" and failed to authenticate me into Azure DevOps.

Strangely enough, all I had to do was log in to the UI and that fixed the problem.