简体   繁体   中英

Using Bundler with Git, is https:// or git:// better?

Using bundler to install a gem from github, there are two obvious choices; https:// or git:// .

From the default rails template;

gem "rails", :git => "git://github.com/rails/rails"

But, when viewing the rails repo on github , the default clone url is the https:// url.

Copying and pasting straight from github, I'd end up with;

gem "rails", :git => "https://github.com/rails/rails.git"

These two lines are almost the same, but not quite.

Is there any benefit to git:// over https:// ?

Is one of them faster to do a bundle install ?

Is doing an https:// checkout easier to cache from githubs perspective?

They will be pretty much the same. If you are behind a firewall etc. you might consider the https one. git protocol might be slightly faster ( and is read-only), but it is negligible.

If you don't care about firewall, use git protocol for bundler purposes as it is the right intent - read only clone of a repo.

The git protocol gives better performance and reliability, but on a host with a web server set up, http exports may be simpler to set up.

follow git user manual. http://schacon.github.com/git/user-manual.html#exporting-via-http

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM