Skip to content
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

Standalone install does not override GCM bundled with Git for Windows #188

Closed
ivan-paleo opened this issue Oct 13, 2020 · 7 comments
Closed
Labels
auth:basic Specific to basic authentication bug A bug in Git Credential Manager host:generic Specific to the generic (basic/WIA) host provider installation Specific to installation and uninstallation

Comments

@ivan-paleo
Copy link

ivan-paleo commented Oct 13, 2020

I have been using the Git Credential Manager (default during Git installation on Win10) until now. But I have read that it is deprecated and that I should use the Git Credential Manager Core instead.
So I have installed the latest release (2.0.252.766) and re-installed Git (2.28.0) selecting the new credential helper.

But now, I have to enter my credentials every time I want to pull or push; they are not saved anymore.
To check, I re-installed Git and selected the old helper again, and my credentials are saved again.

So it seems I have some configuration issues here.

Not sure if this is relevant: I am using 2FA so my password is a token, and I am using Codeberg.org.

I have noticed that when I use the new helper, only 1 credential gets added to the Windows Credential Manager:
git:https://username@codeberg.org
But when I use the old helper, 2 credentials are added:

  • git:https://username@codeberg.org (although I'm not sure anymore whether it was newly created or whether I forgot to delete it from before)
  • git:https://codeberg.org
@mjcheetham
Copy link
Collaborator

Hi @ivan-paleo! Thanks for trying out GCM Core 😁 , and sorry you've encountered some issues.

So I have installed the latest release (2.0.252.766) and re-installed Git (2.28.0) selecting the new credential helper.

Just to check I'm following correctly, you first installed GCM Core 2.0.252.766, and then installed Git for Windows 2.28 (selecting GCM Core from the installer)?

I think I might know what's going on here.. the GCM Core version bundled with the Git for Windows installer is an older version (2.0.194) with a known bug with storing credentials. The version bundled with Git for Windows is taking precedence and being used over the manually installed one.

To confirm this is the case, can you run the following from a command prompt window?

cd path\to\your\repo
SET GCM_TRACE=1
git fetch

You should see some trace logging from GCM Core printed out. What do you see for the version number (first line)? Is is version 2.0.194 or 2.0.252?

11:56:54.110499 ...\Application.cs:69   trace: [RunInternalAsync] Git Credential Manager version 2.0.194-beta+819e6bc120 (Windows, .NET Framework 4.0.30319.42000) 'get'

@mjcheetham mjcheetham added auth:basic Specific to basic authentication bug A bug in Git Credential Manager host:generic Specific to the generic (basic/WIA) host provider installation Specific to installation and uninstallation labels Oct 16, 2020
@ivan-paleo
Copy link
Author

ivan-paleo commented Oct 16, 2020

Thank you @mjcheetham for the feedback!

Here is the output:
Git Credential Manager version 2.0.194-beta+819e6bc120 (Windows, .NET Framework 4.0.30319.42000)
As you guessed, it's an old version.

Now I'll try re-installing Git Credential Manager Core and update my answer.

EDIT: I've now uninstalled and re-installed Git Credential Manager Core and the same happens (same version, same issues).
This means that installing Git first and then Git Credential Manager Core doesn't change the problem.

@mjcheetham
Copy link
Collaborator

Hi @ivan-paleo,

This means that installing Git first and then Git Credential Manager Core doesn't change the problem.

You are correct. We've identified a bug (or rather a bad design assumption) in our installer for GCM Core that I'll start working on shortly. The issue is because of the order in which Git looks over the %PATH% to find the configure credential helper - it always picks the bundled copy and not the standalone version.

Thanks again for picking up on this! 😄

@ivan-paleo
Copy link
Author

In the meantime, I'll revert to the old manager and wait for the bug fix :)
Thank you already for your work!

@mjcheetham mjcheetham changed the title Credentials not saved Standalone install does not override GCM bundled with Git for Windows Oct 19, 2020
@ivan-paleo
Copy link
Author

ivan-paleo commented Oct 20, 2020

It seems to be resolved with the installation of Git 2.29.0.

The output of the commands

SET GCM_TRACE=1
git fetch

is now:
Git Credential Manager version 2.0.252-beta+fe025c12fc

@mjcheetham
Copy link
Collaborator

@ivan-paleo, yes. Git for Windows 2.29 includes the latest available version of GCM Core, so it doesn't matter which version is picked (the bundled one, or the standalone one). I am still working on a fix for the standalone installer, so that GCM Core "vNext" would be able to override 2.0.252 bundled with Git for Windows 2.29 😁

@mjcheetham
Copy link
Collaborator

This issue was corrected in #199 by now always using the full path to the standalone GCM Core after installation. The (older) bundled version will no longer be used in this case.

The fix will be included in the next release of GCM Core.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auth:basic Specific to basic authentication bug A bug in Git Credential Manager host:generic Specific to the generic (basic/WIA) host provider installation Specific to installation and uninstallation
Projects
None yet
Development

No branches or pull requests

2 participants