Skip to content

fix!: do not switch to git+ssh for https repository links#434

Merged
owlstronaut merged 1 commit intonpm:mainfrom
oldium:fix/git-https
Apr 29, 2026
Merged

fix!: do not switch to git+ssh for https repository links#434
owlstronaut merged 1 commit intonpm:mainfrom
oldium:fix/git-https

Conversation

@oldium
Copy link
Copy Markdown
Contributor

@oldium oldium commented Oct 27, 2025

BREAKING CHANGE: git specs using the https or git+https protocol now resolve to git+https URLs instead of being switched to git+ssh. Shortcut specs (e.g. github:user/repo, user/repo) and git+ssh/git:// specs are unchanged.

When the URL explicitly contains https, do not try to switch to ssh. This change is necessary for npm to retain the protocol, please see the link and the referenced issues here and here reporting problems when using ssh instead of requested https.

References

Relates to npm/cli#8703

@oldium oldium requested a review from a team as a code owner October 27, 2025 15:51
@wraithgar wraithgar changed the title bugfix: do not switch to git+ssh for https repository links fix: do not switch to git+ssh for https repository links Nov 13, 2025
When the URL explicitly contains https, do not try to switch to ssh. This
change is necessary for [npm][3] to retain the protocol, please see the
link and the referenced issues [here][1] and [here][2] reporting problems
when using ssh instead of requested https.

[1]: npm/cli#2610
[2]: npm/cli#4305
[3]: npm/cli#8703

Signed-off-by: Oldřich Jedlička <oldium.pro@gmail.com>
@oldium
Copy link
Copy Markdown
Contributor Author

oldium commented Nov 22, 2025

Rebased to latest main

@wraithgar
Copy link
Copy Markdown
Contributor

This kind of change is one that is likely going to need to be a semver major one, out of an abundance of caution. It looks good as-is, but historically this kind of change is pretty disruptive in places we don't expect.

We will keep this PR open, and I have added it to the future changes tracking issue

@wraithgar wraithgar added the semver:major backwards-incompatible breaking changes label Feb 24, 2026
@owlstronaut owlstronaut changed the title fix: do not switch to git+ssh for https repository links fix!: do not switch to git+ssh for https repository links Apr 29, 2026
@owlstronaut owlstronaut merged commit 6d160c1 into npm:main Apr 29, 2026
0 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

semver:major backwards-incompatible breaking changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants