Git: Credential Helper pops up all the time

Created on 31 Jul 2020  路  17Comments  路  Source: git-for-windows/git

  • [ ] I was not able to find an open or closed issue matching what I'm seeing

Setup

  • Which version of Git for Windows are you using? Is it 32-bit or 64-bit?

32-bit

$ git --version --build-options

git version 2.28.0.windows.1
cpu: i686
built from commit: 77982caf269b7ee713a76da2bcf260c34d3bf7a7
sizeof-long: 4
sizeof-size_t: 4
shell-path: /bin/sh
  • Which version of Windows are you running? Vista, 7, 8, 10? Is it 32-bit or 64-bit?

Win7, 32-bit and Win7 64-bit

$ cmd.exe /c ver

Microsoft Windows [Version 6.1.7601]

 - What options did you set as part of the installation? Or did you choose the
   defaults?

One of the following:

type "C:\Program Files\Git\etc\install-options.txt"
type "C:\Program Files (x86)\Git\etc\install-options.txt"
type "%USERPROFILE%\AppData\Local\Programs\Git\etc\install-options.txt"
$ cat /etc/install-options.txt

N/A

 - Any other interesting things about your environment that might be related
   to the issue you're seeing?

** insert your response here **

### Details

 - Which terminal/shell are you running Git from? e.g Bash/CMD/PowerShell/other

** insert your response here **

 - What commands did you run to trigger this issue? If you can provide a
   [Minimal, Complete, and Verifiable example](http://stackoverflow.com/help/mcve)
   this will help us understand the issue.

git push
git pull
```

  • What did you expect to occur after running these commands?

Normal behavior

  • What actually happened instead?

A credential helper window pops up and no matter which selection (and whether I save or not), I always get this popup in subsequent commands.

This only happens on a PRIVATE repository which I created recently, so I can't be sure if this behavior is related to the latest version, or was there already, or if I'm doing something wrong with respect to private repository access as compared to my own public ones.

  • If the problem was occurring with a specific repository, can you provide the
    URL to that repository to help us with testing?

Because it's a private one, I can't.

Most helpful comment

@dwettstein Your suggestion (git config --system credential.helper manager-core) worked for me, too! Thanks.

However, I still think there is a bug in the last version in that the selection in the popup window, and with the checkbox for remembering this chosen option checked, does not 'stick', and one has to keep selecting all the time, unless the above command line option is used making the misbehaving popup window redundant,

All 17 comments

 - What options did you set as part of the installation? Or did you choose the
   defaults?

So, you are using the defaults? Then you are not using Git Credential Manager Core? Perhaps give that a try?

There was no installation, it's the portable edition. I simply copied the files in a directory and run git.
This is something I've done tens of times already with each new update that comes out. It was the first time I had this problem. But also the first time I tried on a private repo.

If I select 'Credential Manager Core' from the popup window, and select 'Always use this from now on', it still pops up the same window next time. This never happened before.

Actually, I just realized, it does so on any repo, not just private.

On private repo, it pops up on both push and pull.
On public repo, it pops up only on push

I went back to previous version and everything works OK. So, it's definitely a problem with the latest version.

I have the same problem when using the latest version. Additionally the following message appears in the console after closing the popup window:

error: key does not contain a section: -

Could it be that GitForWindows is not able to write the selected option to the filesystem or something similar?


Edit:
BTW, what is the option to set GCM Core in .gitconfig?

[credential "helperselector"]
        selected = ???

respectively
git config --system credential.helper ???


Edit 2:
Just found it out:

$ git config --system credential.helper
manager-core

On the other machine the following value is set:

$ git config --system credential.helper
helper-selector

In my case, this was exactly the problem, it always asks which helper to select. Set it as follows:
git config --system credential.helper manager-core (or just manager)

@dwettstein Your suggestion (git config --system credential.helper manager-core) worked for me, too! Thanks.

However, I still think there is a bug in the last version in that the selection in the popup window, and with the checkbox for remembering this chosen option checked, does not 'stick', and one has to keep selecting all the time, unless the above command line option is used making the misbehaving popup window redundant,

Thank you for reporting this issue. My best guess is that this is a bug that was with us for a long time, hidden by a mingw-w64-gcc bug in versions before v10.x, where string format parameters for Unicode strings _really_ need to use the upper-case version %S.

I have a tentative fix in https://github.com/git-for-windows/build-extra/pull/301.

Additionally the following message appears in the console after closing the popup window:

error: key does not contain a section: -

BTW this was _the_ clue I needed to figure out the solution. Thank you so much for that!

I had this issue today on

位 git --version --build-options

git version 2.28.0.windows.1
cpu: x86_64
built from commit: 77982caf269b7ee713a76da2bcf260c34d3bf7a7
sizeof-long: 4
sizeof-size_t: 8
shell-path: /bin/sh

I executed git fetch in Powershell 7.0.3 both as a normal user and as an admin. The "remember" checkbox didn't work. Also in my case there were no additional messages in the console.

I had this issue today on

位 git --version --build-options

git version 2.28.0.windows.1
cpu: x86_64
built from commit: 77982caf269b7ee713a76da2bcf260c34d3bf7a7
sizeof-long: 4
sizeof-size_t: 8
shell-path: /bin/sh

I executed git fetch in Powershell 7.0.3 both as a normal user and as an admin. The "remember" checkbox didn't work. Also in my case there were no additional messages in the console.

Could you try the latest snapshot at https://wingit.blob.core.windows.net/files/index.html ?

I tried, but now I can't bring back the selector window 馃槺 Even though git config credential.helper gives me helper-selector, there is no window, the console directly asks for the password to the remote DevOps.

Can you run git credential-helper-selector manually?

Oh, and what does git config --show-origin --get-all credential.helper say?

credential-helper-selector produces no result.

位 & "D:\PortableGitTest\bin\git.exe" config --show-origin --get-all credential.helper
file:D:/PortableGitTest/etc/gitconfig   helper-selector
位 & "D:\PortableGitTest\bin\git.exe" fetch
Password for 'https://<redacted>@dev.azure.com':

Can you set GIT_TRACE=1 and then run git credential-helper-selector again?

位 & "D:\PortableGitTest\bin\git.exe" credential-helper-selector
07:57:10.823095 exec-cmd.c:237          trace: resolved executable dir: D:/PortableGitTest/mingw64/bin
07:57:10.824095 git.c:710               trace: exec: git-credential-helper-selector
07:57:10.824095 run-command.c:663       trace: run_command: git-credential-helper-selector

And just to make sure I'm running the latest snapshot:

位 & "D:\PortableGitTest\bin\git.exe" --version --build-options
07:58:17.614888 exec-cmd.c:237          trace: resolved executable dir: D:/PortableGitTest/mingw64/bin
07:58:17.615889 git.c:444               trace: built-in: git version --build-options
git version 2.29.0.rc0.windows.1
cpu: x86_64
built from commit: 58a43b46e3811645a1fe75703627576b0a97f7eb
sizeof-long: 4
sizeof-size_t: 8
shell-path: /bin/sh

Same for me:

PS C:\Users\me> .\repros\PortableGit\cmd\git.exe credential-helper-selector
11:19:47.735703 exec-cmd.c:237          trace: resolved executable dir: C:/Users/me/repros/PortableGit/mingw64/bin
11:19:47.735703 git.c:710               trace: exec: git-credential-helper-selector
11:19:47.735703 run-command.c:663       trace: run_command: git-credential-helper-selector

At that point, this dialog pops up:

image

FWIW, I tested with the latest snapshot:

git version 2.29.0.rc0.windows.2
cpu: x86_64
built from commit: 190f8d918d77b8c9dc2406f0a60adc925ef6e7a6
sizeof-long: 4
sizeof-size_t: 8
shell-path: /bin/sh
Was this page helpful?
0 / 5 - 0 ratings

Related issues

michaelblyons picture michaelblyons  路  5Comments

vocaviking picture vocaviking  路  5Comments

dlk-pavan picture dlk-pavan  路  4Comments

daxelrod picture daxelrod  路  4Comments

dscho picture dscho  路  3Comments