-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
hub clone should use HTTPS instead of SSH by default so the GCM can be used #1596
Comments
Thanks for suggesting. I have already planned to switch to HTTPS by default, but no open issue to track that exists except a brief discussion in #1318. In the meantime you can do: git config --global hub.protocol https |
I'm interested in taking up this issue since it's in the hub 2.3 project. Should the behavior be like in #1318 where all remote URLs use |
@darrenwee All URLs across the board should be affected. Changing this shouldn't be too much work in the implementation itself, but it will break a lot of tests. Let me know how it goes! |
How to I revert back to making ssh urls default for hub? |
@gayanhewa my guess is you can edit your global gitconfig (on OSX it's at
|
@mpacer I have the same question as @gayanhewa, how would I make hub default to SSH (not HTTPS). I tried
but am still prompted for https credentials and MFA. any thoughts? I am a brand new hub user, so maybe I am missing something obvious :) |
@johnk-novu You will still be prompted for HTTPS credentials on first run because hub needs to access the GitHub API, and it can only do so over HTTPS and not SSH (the latter is used for git operations such as clone, pull, push). #1644 (comment) |
@mislav ah, that makes sense. thanks so much! |
@mislav I want to add a section about the |
@jedwards1211 The site is the |
Thanks! |
Doing and the remote urls didn't use https
|
@rbavery We have a test that verifies that HTTPS is respected when using Are you on the latest version? |
I found this was left over from before I had changed the default protocol, all good! |
Seems like this issue can be closed, as it has been addressed in #2939 🎉 |
probably should be another release then, current one is 2020 |
When interacting with a GitHub repo via HTTPS, the Git Credential Manager for Windows is used by default (it is installed by default with Git for Windows). The GCM is great, because it supports GitHub 2FA, so you don't need to create a token or SSH key but can just log in with your username, password and 2FA token.
However,
hub clone
uses the SSH URL of the repo by default (instead of the HTTPS URL). This means that when a user installs hub and blindly does ahub clone
on a repo, they won't be able to use the GCM (and thus will need to do extra configuration if they have 2FA set up).This seems like an oversight. Therefore, I propose using HTTPS instead of SSH by default (at least on Windows).
The text was updated successfully, but these errors were encountered: