-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Credential Helper pops up all the time - Take 2 for portable 2.44.0.windows.1 - global does not overwrite system #4844
Comments
Note that multiple values for |
(You'll need to add the helper you want using |
Interesting. I just did a fresh unzip again of PortableGit-2.44.0-64-bit.7z
and with this empty global config it now asks for password, meaning it overwrites the system selector but doesn't allow using the manager. So you are saying credential.helper is a list, and we add to the list, so both global and system is read? I don't quite understand why not that you have to teach me... Here's some more tests of the same with
So the middle I was expecting git to replace the system choice with the global choice. |
The See the output of |
Thank you for that info, that makes more sense to me. I can confirm that with these global settings it does indeed work and ignore/overwrite the system settings:
Running the suggested command did not, as the second execution setting the manager, overwrites the empty value. But that's not a problem to me, editing the file is fine for me, as I move my global .gitconfig between systems. This solves for me the main part of the issue. |
This issue closed issue is HIGHLY related: #2776
I'm seing the exact same thing, but possibly for other reason. I'll describe below.
Setup
64-bit, 2.44.0.windows.1, Portable
Win 11, 64-bit, freshly installed.
defaults?
Portable installation (unzip) of this:
https://github.com/git-for-windows/git/releases/download/v2.44.0.windows.1/PortableGit-2.44.0-64-bit.7z.exe#/dl.7z
Note that
c:\ProgramData\scoop\apps\git\current\etc\install-options.txt
does not exists (git is installed in that dir).I also tested directly on my own extraction setting path directly here, to ensure no conflict with other installs:
$env:path="D:\Users\Alex\Downloads\PortableGit\cmd"
I compare below with installation (seen in chocolatey, but I ran the install myself to ensure nothing was touched)
https://github.com/git-for-windows/git/releases/download/v2.44.0.windows.1/Git-2.44.0-64-bit.exe
Install Command:
Git-2.44.0-64-bit.exe /VERYSILENT /SUPPRESSMSGBOXES /NORESTART /NOCANCEL /SP- /LOG
to the issue you're seeing?
The portable extraction is only writable by the administrator, and that is the problem, as I'll describe below. Though the deeper problem is that global config is ignored, when system is found.
Details
PowerShell 7
Minimal, Complete, and Verifiable example
this will help us understand the issue.
That when I apply 'always ' in credential selector it will be remembered. See dialog i am referring to in attached screenshot
or here:
https://kevinfiol.com/blog/getting-rid-of-the-credential-helper-selector-on-git-for-windows/
PS: I found this above link searching for the image, and apparently I'm not the only one discovering this issue, though I may have more info.
it didn't update the system config
c:\ProgramData\scoop\apps\git\current\etc\gitconfig
Hence the next execution shows the same dialog.
My global config file contains the
credential.helper=manager
The portable 7z file contains this:
I tested it (besides in scoop) directly by extracting portable, removing inheritance rights and ensuring my normal user could not write the etc/gitconfig.
Running
git fetch
as Administrator user in a private github repository WILL correctly update the system file. However given the documentation here I would have thought that global should overwrite system: https://git-scm.com/book/en/v2/Customizing-Git-Git-ConfigurationIt will also work setting the system config to :
credential.helper=manager
or removing the line.In the non-portable install, the system gitconfig is
credential.helper=manager
, and therefore when installing git through that method in program-files, this issue does not occur - see above full link of v2.44.0.windows.1/Git-2.44.0-64-bit.exeSo there seems to be two problems. One is that the credential.helper doesn't see the global config, and the other that that the Portable install defaults to
helper-selector
which is a problem for those who set admin-modify only on the git-folder (because we don't want any program to be able to write the program files, even if its a portable install).Personally, I'll just run
git config --system credential.helper manager
in my install-scripts after installing git. But that doesn't help others.The text was updated successfully, but these errors were encountered: