Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Force composer to download git repo instead of zip

I have some problem with composer.

 "require": {
        "php":                ">=5.3.2",
        "kriswallsmith/buzz": "0.7"
    },

Repo https://github.com/kriswallsmith/Buzz/tree/v0.7

Unfortunately github returns 502 for this request https://github.com/kriswallsmith/Buzz/zipball/v0.7

Request URL:https://nodeload.github.com/kriswallsmith/Buzz/zipball/v0.7
Status Code: 502 Bad Gateway

Luckily git clone still works ;)

Is it possible to tell/ask composer to user git clone instead of downloading zipball for this one dependency?

like image 330
mrok Avatar asked Aug 29 '12 08:08

mrok


2 Answers

The quickest solution is to run install or update with the option --prefer-source

php composer.phar install --prefer-source

In this way git clone will be used for all dependencies, I don't know if there's a setting to limit to one dependency only.

like image 194
mgiagnoni Avatar answered Sep 21 '22 18:09

mgiagnoni


As explained in preferred-install order matters. I've tested on Composer version 1.8.3 2019-01-30 08:31:33

"config": {
    "preferred-install": {
        "drupal/external_entities": "source",
        "*": "dist"
    }
}

Next ran

composer require drupal/external_entities

and the git repo appeared.

like image 25
Clemens Tolboom Avatar answered Sep 19 '22 18:09

Clemens Tolboom