0

I have a Git project that is hosted on visualstudio.com. Whenever I initiate a git push or git pull, it always pops open the Team Services login window, which I then have to close, since logging in from that window takes longer and requires a redirect. Then I can use Git Bash to enter my credentials and it works.

This didn't happen until recently when I updated my Git install version. How do I stop the window from popping up every time? Here's a screenshot of the window that pops up.

Esther Fan - MSFT
  • 8,276
  • 4
  • 27
  • 25
Longblog
  • 821
  • 2
  • 11
  • 19

2 Answers2

2

That window is opened by Microsoft's Git Credential Manager and is useful if you use two-factor authentication (2FA) with GitHub or MFA with VSTS. It is now installed by default along with Git for Windows.

If you wish to disable this, you can turn off Microsoft's Git Credential Manager. Simply run:

git config --global --unset credential.helper
Edward Thomson
  • 74,857
  • 14
  • 158
  • 187
  • This didn't do anything. It still pops up. – Longblog Aug 23 '16 at 19:15
  • 1
    Can you post the results of `git config --list` in your question? – Edward Thomson Aug 23 '16 at 19:40
  • @EdwardThomson Is the `.` at the end of that command superfluous? – Scott Weldon Aug 23 '16 at 19:45
  • 1
    @ScottWeldon That was a typo - corrected. Thanks! :D – Edward Thomson Aug 23 '16 at 19:50
  • 1
    @Longblog Can you try this again now that it's been corrected? – Edward Thomson Aug 23 '16 at 19:51
  • I tried again and it still popped up. So, I ran the `git config --list` command you mentioned and saw credential.helper=manager was still set. I googled that and found [this page](http://stackoverflow.com/questions/16052602/disable-git-credential-osxkeychain). I ran all three commands and ran into a permissions error on the third one. So I opened that file location, changed permissions, opened it in Sublime Text and deleted the credential helper line. It's fixed now! It's not popping up anymore, annoying me every time I have to pull or push. Thanks for your assistance guys. Edit: formatting – Longblog Aug 26 '16 at 15:40
1

According to the gitcredentials documentation:

Without any credential helpers defined, Git will try the following strategies to ask the user for usernames and passwords:

  1. If the GIT_ASKPASS environment variable is set, the program specified by the variable is invoked. A suitable prompt is provided to the program on the command line, and the user’s input is read from its standard output.

  2. Otherwise, if the core.askPass configuration variable is set, its value is used as above.

  3. Otherwise, if the SSH_ASKPASS environment variable is set, its value is used as above.

  4. Otherwise, the user is prompted on the terminal.

Thus, to force option 4 to take effect, you need to ensure that the three other values are not set.

For 1 and 3, you should be able to do e.g. SSH_ASKPASS=''. (To automate this, add that line to C:\Users\<user>\.bashrc.) For 2, do git config --unset-all core.askPass.


As you can tell from the first line of the quote, this only applies if you don't have any credential helpers defined. If you do, then you can unset them as described in EdwardThomson's answer.

Community
  • 1
  • 1
Scott Weldon
  • 9,673
  • 6
  • 48
  • 67