Closed goodguyry closed 5 years ago
Hmm I'm thinking it's related to https://github.com/paulirish/git-open/pull/109 (cc @4U6U57)
Do you have anything in your ~/.ssh/config
file related to aliases for github like this?
Yep, that's it! When I comment out those lines in my SSH config git open
opens the expected URL.
What's your reasoning for having an alias from github.com
-> ssh.github.com
?
I'm not certain. I was surprised to see it there. Best I can tell it came from https://help.github.com/articles/using-ssh-over-the-https-port/, but I haven't noticed any adverse effects since disabling it.
Any update on this?
No update. The script is working as expected since removing the GitHub lines from my ~/.ssh/config
, though I'm not certain that's a viable solution.
Cool, working now. Thanks!
I was cleaning up my GitHub notifications and spotted this old thread. Just wanted to clarify the issue and possible solutions.
GitHub supports SSH over HTTPS by mapping github.com
to ssh.github.com
, as mentioned here:
I'm not certain. I was surprised to see it there. Best I can tell it came from https://help.github.com/articles/using-ssh-over-the-https-port/, but I haven't noticed any adverse effects since disabling it.
The problem is that git open
expects any ssh domain to map to a corresponding repo page over http, which is true for git@github.com
but not true for git@ssh.github.com
(ssh.github.com
gives ERR_SSL_PROTOCOL_ERROR
, it doesn't serve webpages). So this is a caveat of GitHub's design/usage of their ssh.github.com
subdomain.
To fix git open
's treatment of this subdomain, you can either:
~/.ssh/config
, as previously recommended)ssh.github.com
back to github.com
within git open
's config, by running:git config --global open.https://ssh.github.com.domain github.com
Since upgrading (from which version I'm not sure),
git open
is opening URLs at a nonexistentssh
subdomain. The repos were all cloned with SSH, in case that has something to do with it. This was never an issue before...Thanks. Let me know if you need additional info.
If an incorrect URL is opened, please provide the following so we can write a test:
Example clone url:
https://github.com/goodguyry/postcss-tidy-columns
Example branch name:
master
Expected web URL:
https://github.com/goodguyry/postcss-tidy-columns
Actual web URL:
https://ssh.github.com/goodguyry/postcss-tidy-columns