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

git-credential-manager.exe doesn't exist #1155

Closed
BeyondEvil opened this issue Mar 16, 2023 · 4 comments
Closed

git-credential-manager.exe doesn't exist #1155

BeyondEvil opened this issue Mar 16, 2023 · 4 comments
Labels
auth-issue An issue authenticating to a host

Comments

@BeyondEvil
Copy link

Version

2.0.935+8b4735fc7b

Operating system

Windows

OS version or distribution

Windows 10 Enterprise (20H2 19042.2604)

Git hosting provider(s)

Azure DevOps Server (TFS/on-prem)

Other hosting provider

No response

(Azure DevOps only) What format is your remote URL?

https://{org}@dev.azure.com/{org}

Can you access the remote repository directly in the browser?

Yes, I can access the repository

Expected behavior

Following the documentation leads to successfully being able to clone from Azure using HTTPS.

Actual behavior

According to the documentation, the binay should be called git-credential-manager.exe.

But this .gitconfig (in WSL):

[user]
        name = My Name
        email = my.name@company.se
[credential]
        helper = /mnt/c/Users/jibr01/AppData/Local/Programs/Git/mingw64/libexec/git-core/git-credential-manager.exe
[credential "https://dev.azure.com"]
        useHttpPath = true

Generates the following error:

$ git clone https://org@dev.azure.com/org/Utvecklingsstod/_git/argo-cd
Cloning into 'argo-cd'...
/mnt/c/Users/jibr01/AppData/Local/Programs/Git/mingw64/libexec/git-core/git-credential-manager.exe get: 1: /mnt/c/Users/jibr01/AppData/Local/Programs/Git/mingw64/libexec/git-core/git-credential-manager.exe: not found

Note about the path, which also isn't what the documentation suggests, is likely because I'm on an Enterprise/AD setup.

PS C:\Users\jibr01\AppData\Local\Programs\Git\mingw64\libexec\git-core> dir git-c*


    Directory: C:\Users\jibr01\AppData\Local\Programs\Git\mingw64\libexec\git-core


Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a----        2023-03-14     07:12            687 git-citool
-a----        2023-03-14     07:12          58960 git-credential-wincred.exe

The Git for Windows version (from PS):

git --version
git version 2.40.0.windows.1

Credential manager works if I git clone in PS (only had to auth the first time).

PS W:\dev\org> git clone https://org@dev.azure.com/org/Utvecklingsstod/_git/pipeline-templates
Cloning into 'pipeline-templates'...
(the first time at this point the cred manager auth windows was openend)
remote: Azure Repos
remote: Found 1083 objects to send. (93 ms)
Receiving objects: 100% (1083/1083), 291.05 KiB | 164.00 KiB/s, done.
Resolving deltas: 100% (501/501), done.
Updating files: 100% (50/50), done.

If I update the path in the .gitconfig (in WSL) to the wincred one, I doesn't complain - but it asks for the password and doesn't use the manager:

$ git clone https://org@dev.azure.com/org/Utvecklingsstod/_git/argo-cd
Cloning into 'argo-cd'...
Password for 'https://org@dev.azure.com/org/Utvecklingsstod/_git/argo-cd':

.gitconfig (in Windows):

gc .\.gitconfig
[core]
        editor = \"C:\\Users\\jibr01\\AppData\\Local\\Programs\\Microsoft VS Code\\bin\\code\" --wait
[credential]
        helper = wincred
git credential-manager-core diagnose

warning: git-credential-manager-core was renamed to git-credential-manager
warning: see https://aka.ms/gcm/rename for more information
Running diagnostics...

 [ OK ] Environment
 [ OK ] File system
 [ OK ] Networking
 [ OK ] Git
 [ OK ] Credential storage
 [ OK ] Microsoft authentication (AAD/MSA)
 [ OK ] GitHub API

Diagnostic summary: 7 passed, 0 skipped, 0 failed.
Log files:
  C:\Users\jibr01\AppData\Local\Programs\Git\mingw64\libexec\git-core\gcm-diagnose.log

Caution: Log files may include sensitive information - redact before sharing.

Sorry, if I'm missing something obvious, I haven't used Windows in over 10 years.

Logs

$ WSLENV=$WSLENV:GCM_TRACE:GIT_TRACE GCM_TRACE=1 GIT_TRACE=1 git clone  https://org@dev.azure.com/org/Utvecklingsstod/_git/argo-cd
00:16:21.461514 git.c:460               trace: built-in: git clone https://org@dev.azure.com/org/Utvecklingsstod/_git/argo-cd
Cloning into 'argo-cd'...
00:16:21.472964 run-command.c:655       trace: run_command: git remote-https origin https://org@dev.azure.com/org/Utvecklingsstod/_git/argo-cd
00:16:21.473949 git.c:750               trace: exec: git-remote-https origin https://org@dev.azure.com/org/Utvecklingsstod/_git/argo-cd
00:16:21.473997 run-command.c:655       trace: run_command: git-remote-https origin https://org@dev.azure.com/org/Utvecklingsstod/_git/argo-cd
00:16:21.640074 run-command.c:655       trace: run_command: '/mnt/c/Users/jibr01/AppData/Local/Programs/Git/mingw64/libexec/git-core/git-credential-wincred.exe get'
Password for 'https://org@dev.azure.com/org/Utvecklingsstod/_git/argo-cd':
@BeyondEvil BeyondEvil added the auth-issue An issue authenticating to a host label Mar 16, 2023
@BeyondEvil
Copy link
Author

So, apparently, I can't read. But in my defense, the binary was moved in v2.36.1 (of Git for Windows).

So, using the correct path under bin and like magic it's all working as expected.

This helped me see the errors of my way: https://learn.microsoft.com/en-us/windows/wsl/tutorials/wsl-git

Will leave ticket open for maintainers to close. I'll proudly wear the cone of shame.

@dscho
Copy link
Collaborator

dscho commented Mar 17, 2023

@BeyondEvil maybe you can think of a way to improve the documentation? I mean, if this issue hit you, it'll probably hit others, too. And if we can improve the documentation (or help the users in any other way), that'd be good, right?

@BeyondEvil
Copy link
Author

@BeyondEvil maybe you can think of a way to improve the documentation? I mean, if this issue hit you, it'll probably hit others, too. And if we can improve the documentation (or help the users in any other way), that'd be good, right?

For sure, I'll see if I can come up with something that will help. It could be as easy as "Note: that the path for older versions were different" and/or adding some instructions on how to search/find the path to the correct binary.

@ldennington
Copy link
Contributor

Thanks for bringing this to our attention! We went ahead and added a callout in the docs here. Will close this issue on merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auth-issue An issue authenticating to a host
Projects
None yet
Development

No branches or pull requests

3 participants