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:

  1. 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:

  1. User runs git pull
  2. GCM checks for token for user test - token is missing (not in cache, that's OK)
  3. GCM asks user to login using browser
  4. GCM Stores token in cache with user oauth (not test)
  5. git pull is successful
  6. User runs git pull again
  7. GCM checks for token for user test - token is not found due to invalid user!
  8. GCM asks user again to login using browser

Logs

No response

Source: git-ecosystem/git-credential-manager