Reputation: 30761
While I am developing, there are certain dependencies that I want to have as git clones.
(Partly in case I find bugs and want to submit patches, also because when I'm trying to work things out I pepper code with debug statements, and git lets me clean them all up in one go!).
But all the packages that composer downloads are plain files.
How do I get composer to save packages as git clones? Ideally just some of them, not all of them.
Upvotes: 0
Views: 877
Reputation: 9582
Run
$ composer install --prefer-source
to install all dependencies from source (where available).
See https://getcomposer.org/doc/03-cli.md#install:
--prefer-source: There are two ways of downloading a package:
source
anddist
. For stable versions Composer will use thedist
by default. Thesource
is a version control repository. If--prefer-source
is enabled, Composer will install fromsource
if there is one. This is useful if you want to make a bugfix to a project and get a local git clone of the dependency directly.
Alternatively, configure selected dependencies to be installed from source (or dist) under the preferred-install
section in composer.json
:
{
"config": {
"preferred-install": {
"foo/bar": "source",
"bar/baz": "source",
"*": "dist"
}
}
}
See https://getcomposer.org/doc/06-config.md#preferred-install:
Defaults to
auto
and can be any ofsource
,dist
orauto
. This option allows you to set the install method Composer will prefer to use. Can optionally be a hash of patterns for more granular install preferences.
Upvotes: 4