Skip to content

GCM Settings does not support port numbers #608

Description

@mminns

Which version of GCM are you using?

All versions

Which Git host provider are you trying to connect to?

  • Azure DevOps
  • Azure DevOps Server (TFS/on-prem)
  • GitHub
  • GitHub Enterprise
  • Bitbucket
  • Other - please describe

Can you access the remote repository directly in the browser using the remote URL?

  • Yes
  • No, I get a permission error
  • No, for a different reason - please describe

[Azure DevOps only] What format is your remote URL?

[Azure DevOps only] If the account picker shows more than one identity as you authenticate, check that you selected the same one that has access on the web.

  • Not applicable
  • I only see one identity
  • I checked each identity and none worked

Expected behavior

I can specify git configuration overrides using the exact url of my host server and have them picked up, e.g.

For my development Bitbucket server it runs at http://localhost:7990/bitbucket. I want to shortcut the auto-discovery process and tell GCM this URL refers to a Bitbucket instance, so I try:

❯ git config --global credential.http://localhost:7990/bitbucket.provider bitbucket

I would expect this stop the auto-detect process, but it doesn't

Actual behavior

In order to get the desired result I have to use:

❯ git config --global credential.http://localhost/bitbucket.provider bitbucket

This is because GitCredentialManager.UriExtensions.GetGitConfigurationScopes() ignores the port number.

To add context for a Git URL like:

> git clone http://localhost:7990/bitbucket/scm/project_1/rep_1.git

Git will pass the following to GCM

protocol=http
host=localhost:7990

But the port is ignored in Settings

Further context Git itself correctly matches the following:

> git config --global credential.http://localhost:7990/bitbucket.usehttppath true

Logs

N/A

Metadata

Metadata

Assignees

Labels

auth-issueAn issue authenticating to a hostbugA bug in Git Credential Managergood-first-issueA good issue or enhancement for a first time contributor

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions