Skip to content

Git - extension API gives repository remotes with aliases #174941

@alexr00

Description

@alexr00

From @ashb in microsoft/vscode-pull-request-github#4551:

I have the following lines in my ~/.gitconfig:

[url "https://github.com/"]
  insteadOf = "github:"
  pushInsteadOf = "[email protected]:"
[url "[email protected]:"]
  insteadOf = "gh:"
  pushInsteadOf = "github:"
  pushInsteadOf = "git://github.com/"

(The effect is that I can do git clone github:user/public or git clone gh:user/private)

However I think the extension is getting confused about the gh: prefix and not reflecting my global git config.

For example, on such a private repo:

$ git config remote.origin.url
gh:user/private
$ git remote get-url origin
[email protected]:user/private

$ git remote show origin -n
* remote origin
  Fetch URL: [email protected]:user/private
  Push  URL: [email protected]:user/private

When using the git extension API to get information about a repo that's been set up like this, the repository's remote doesn't have a meaningful url:
image

I don't see a way to resolve this URL to something meaningful using the git extension API. I think ideally the git extension API would resolve the fetch and push URLs instead of using the aliases.

Metadata

Metadata

Labels

feature-requestRequest for new features or functionalitygitGIT issues

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions