Skip to content

fix: normalize ssh.github.com to github.com for URL generation#232

Open
wuwb wants to merge 1 commit intopaulirish:masterfrom
wuwb:master
Open

fix: normalize ssh.github.com to github.com for URL generation#232
wuwb wants to merge 1 commit intopaulirish:masterfrom
wuwb:master

Conversation

@wuwb
Copy link
Copy Markdown

@wuwb wuwb commented Mar 24, 2026

Problem

When using GitHub's SSH-over-HTTPS gateway (configured via ~/.ssh/config), the remote URL is returned as ssh://git@ssh.github.com/..., causing git-open to generate an invalid URL like https://ssh.github.com/owner/repo which cannot be opened in a browser.

This commonly happens when connecting to GitHub via SSH over port 443 (e.g., corporate networks that block port 22):

Host github.com
    HostName ssh.github.com
    Port 443

Fix

Normalize the ssh.github.com gateway hostname back to github.com before generating the browser URL.

Before vs After

Remote URL Generated URL (before) Generated URL (after)
ssh://git@ssh.github.com/owner/repo https://ssh.github.com/... https://github.com/...
git@github.com:owner/repo (no change) https://github.com/... https://github.com/...

When using GitHub's SSH-over-HTTPS gateway (ssh.github.com),
the remote URL is returned as ssh://git@ssh.github.com/..., causing
git-open to generate invalid URLs like https://ssh.github.com/...

This fix normalizes the domain back to github.com so that the
generated browser URL is always valid.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant