Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does github offer two download methods?

Tags:

github

Github allows you to clone a public repository in one of two ways. The two methods toggle on the download section of the repository home page:

https://github.com/scrooloose/nerdtree.git

git://github.com/scrooloose/nerdtree.git

The git clone command works with both so why are there two methods available? Can you explain why you would use one over the other?

like image 648
Milktrader Avatar asked Jul 21 '26 14:07

Milktrader


1 Answers

The git protocol has the following key problems:

  • The conventional port that the service is run on (9418) may not be accessible behind restrictive firewalls.
  • There is no user authentication, which means that generally the protocol is only used for read-only access.

On the other hand, it's very efficient for fetching from git repositories.

As for HTTPS, GitHub now supports the "smart HTTP" protocol, which means that many of the problems with the "dumb HTTP" protocol that you'll read about (e.g. inefficiency) no longer really apply, although it still won't be as efficient as the git protocol. The chief advantage of using HTTPS to talk to GitHub repositories is it is very unlikely that corporate firewalls will block access to port 443.

(Incidentally, the scope of your question is only about access to public repositories with the git protocol and HTTPS, but I think it's worth pointing out that there are many other considerations for the choice of protocol in the case where you need to authenticate yourself in order to push to a repository.)

like image 191
Mark Longair Avatar answered Jul 24 '26 16:07

Mark Longair



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!