1

Recently, I think after installing a visual studio update, I get a popup "Sign in to your Microsoft account" each time I run a git command line on a TFS repository (hosted on visualstudio.com). If I just close the popup, it works (because I've configured my alternate credentials).

This is annoying, because my scripts that could work unattended before are now requiring me to manually close the popup. How can I disable it completely?

Daniel Mann
  • 57,011
  • 13
  • 100
  • 120
youen
  • 1,952
  • 1
  • 23
  • 32
  • Which credential do you enter in the sign in dialog? – Eddie Chen - MSFT Jun 06 '16 at 02:10
  • Just to clarify: the new popup (which is Git Credential Manager according to @Eddie-MSFT answer, and not a visual studio thing) is working fine. I was just troubled that it appeared out of nowhere, was preventing unattended execution of my scripts, and was completely unnecessary. However, since the previous crendential store is apparently not maintained anymore, I'm going to use the new system. – youen Jun 06 '16 at 07:16
  • It seems I was wrong in my previous comment: while `winstore` is deprecated in favor of `manager`, the other credential helpers, such as `wincred`, are unaffected. In my case, the credential helper I used before was `wincred`, not `winstore`, and still is the one that best fits my needs (see my answer below to use it instead of `manager`). – youen Jul 11 '16 at 08:09

2 Answers2

2

Thanks to Jez that posted a similar question here, I found the solution. Edit file C:\Program Files\Git\mingw64\etc\gitconfig and change the line helper = manager to helper = wincred (for example). You may also want to check C:\Users\your-user-name\.gitconfig and the local config of your repository (.git/config). It appears git uses all credential helpers found in these config files, instead of using only the most specific.

Also, if you install Git yourself, you have a checkbox during installation to disable the new manager. But when visual studio installs git for you, it will enable it without asking.

Community
  • 1
  • 1
youen
  • 1,952
  • 1
  • 23
  • 32
1

The "Sign in to your Microsoft account" dialog is provided by Git Credential Manager (GCM) which allow you to just enter your VSTS credential directly without configuring the alternative credential, try to install the latest version and make sure you enter the correct credential to see if it can works correctly.

And according to your description, you have also configured your alternative credentials. Then if the GCM does not work correctly, you can run command:

git config --global credential.helper store

to use "store" as the credential provider instead of "GCM". After run this command, the dialog should not pop up anymore and you need to use the alternative credential when the command line ask for username and password.

By the way, there is another people get a similar behavior as you and logged an issue on the GCM project. Refer to this link for details: Not authenticating any more.

Eddie Chen - MSFT
  • 29,708
  • 2
  • 46
  • 60
  • Thanks for the GCM link. If I understand correctly, it's a new system to replace the previous credential store. I thought it was a visual studio thing, that they forcefully installed and integrated with git, and was messing with my existing workflow. I also don't want a global authentication scheme that makes VS stay connected to my account all the time, but apparently that's not the case. The popup actually works fine, it's just that I don't need it (I can even close it without entering credentials and it still works). Your command line didn't change anything though. – youen Jun 06 '16 at 07:12