.gitconfig credential helper path does not work on Windows
By chrullrich (@chrullrich),
Description
When creating a repository (on a self-hosted instance) and selecting to configure Git to access it, the resulting entry in ~/.gitconfig does not work.
Expected Behavior vs Actual Behavior
- Expected behavior: Git can access the repository.
- Actual behavior:
git push gitlab master [...]\glab_1.17.0_Windows_x86_64\bin\glab.exe auth git-credential get: [...]glab_1.17.0_Windows_x86_64binglab.exe: command not found Username for 'https://my.gitlab.instance':
Possible Fix
From .gitconfig:
[credential]
helper =
[credential "https://my.gitlab.instance"]
helper =
helper = ![...]\\glab_1.17.0_Windows_x86_64\\bin\\glab.exe auth git-credential
The problem was fixed after doubling the already doubled backslashes; i.e. this works:
[credential]
helper =
[credential "https://my.gitlab.instance"]
helper =
helper = ![...]\\\\glab_1.17.0_Windows_x86_64\\\\bin\\\\glab.exe auth git-credential
Steps to Reproduce
- Download the .zip release of GLab and extract. Put on PATH.
-
glab auth loginwith a token provided by the self-hosted GitLab instance. -
glab repo create myrepo. Choose to configure Git to authenticate with GitLab credentials. -
git remote add gitlab https://my.gitlab.instance/me/myrepo -
git push gitlab master
Your Environment
- Version used (Run
glab --version): glab version 1.17.0 (2021-05-14) - Operating System and version: Windows
- Git: 2.31.1.windows.1
Last updated: 2021-06-27T16:54:07.989Z
https://gitlab.com/profclems/glab/-/issues/278
The bot that imported the bug lost one set of backslashes. The "possible fix" section should read:
From .gitconfig:
[credential] helper = [credential "https://my.gitlab.instance"] helper = helper = ![...]\\glab_1.17.0_Windows_x86_64\\bin\\glab.exe auth git-credentialThe problem was fixed after doubling the already doubled backslashes; i.e. this works:
[credential] helper = [credential "https://my.gitlab.instance"] helper = helper = ![...]\\\\glab_1.17.0_Windows_x86_64\\\\bin\\\\glab.exe auth git-credential
This issue has been automatically marked as stale because it has not had recent activity. We haven't had the time to address it yet, but we want to keep it open. This message is just a reminder for us to help triage issues.