git clone supports both HTTPS and SSH remote URLs. Which should I use? What are the advantages of each?
GitHub’s docs don’t make a recommendation either way. I recall in 2013 GitHub used to recommend SSH (archive link). Why was that?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
GitHub have changed their recommendation several times (example).
It appears that they currently recommend HTTPS because it is the easiest to set up on the widest range of networks and platforms, and by users who are new to all this.
There is no inherent flaw in SSH (if there was they would disable it) — in the links below, you will see that they still provide details about SSH connections too:
HTTPS is less likely to be blocked by a firewall.
https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls
An HTTPS connection allows
credential.helperto cache your password.https://docs.github.com/en/get-started/quickstart/set-up-git#connecting-over-https-recommended