Frederic De Smet
Frederic De Smet

Reputation: 121

How do I know which git authentication method is being used?

Is there a way to verify through which way I'm authenticating to Azure DevOps?

Upvotes: 12

Views: 19487

Answers (2)

heather
heather

Reputation: 61

I found setting GIT_TRACE=1 to be useful for debugging Git. (I found that from this page.)

git config --list --show-origin will also show if you're configured to use any credential.helper such as Git Credential Manager Core.

Upvotes: 6

WaitingForGuacamole
WaitingForGuacamole

Reputation: 4301

For git authentication with Azure DevOps, the first thing I'd do is to run

git remote show origin

If the Fetch and Push URLs start with git:, you're using an SSH key. If it starts with https:, it's going to do an OAuth browser login to Azure DevOps, and then display a message telling you that you're signed in and can close the browser window, at which point Git will have the credential it needs to work with the remote repository. In my experience, it works the same way in VS Code - it uses whatever credential the Git application has negotiated.

The Azure CLI should not come into play with Git - it can be used to manipulate Azure DevOps features, but does not participate directly in the source control process (other than allowing things like PR submission, etc.)

Upvotes: 6

Related Questions