GitLab: Ignore username from Git credential input when looking up and generating credentials
Author: tjuchniewiczCreated Feb 20, 2026Updated Jul 10, 2026
Labelsauth-issuehost:gitlab
Version
2.7.0.0
Operating system
Windows
OS version or distribution
Windows 11
Git hosting provider(s)
GitLab
Other hosting provider
No response
(Azure DevOps only) What format is your remote URL?
None
Can you access the remote repository directly in the browser?
Yes, I can access the repository
Expected behavior
Expected Behavior
The GitLab provider should:
- Completely ignore the username from Git's credential input with OAuth
Rationale
- Using the input username can cause incorrect credential lookups and confusing authentication prompts
Actual behavior
Current Behavior
When Git passes a username in the credential request (e.g., username=test when remote.origin.url=https://[email protected]), the GitLab provider:
- User runs
git pull - GCM checks for token for user
test- token is missing (not in cache, that's OK) - GCM asks user to login using browser
- GCM Stores token in cache with user
oauth(nottest) git pullis successful- User runs
git pullagain - GCM checks for token for user
test- token is not found due to invalid user! - GCM asks user again to login using browser
Logs
No response
Source: git-ecosystem/git-credential-manager