Search code examples
phpgitclone

How to force composer to use zip instead of git clone?


Wen I use composer to update/install a new project it starts cloning a lot of git repositories. If you have a lot of dependencies, this takes ages. After all I just need the latest version of all the libraries. I'm not going to change anything.

Is there a way to tell composer to download the requested version without cloning? Just fetching the zip version from github would be much faster.


Solution

  • Accoding to https://github.com/composer/composer/issues/840 this is not possible.

    I think we need to add an option for this at some point. What @stof said is not true. The thing is that with dev packages, the chance of updating them on update is much higher than if you just follow tags, and updates are much cheaper once you have a git clone than redownloading the full thing every time. It's a trade-off. But we should probably add a --prefer-dist flag.