I want to add a new package which is not at packagist, it's a local or non-public repository. I know how to this in the composer.json
. For example:
"repositories": [ { "type": "vcs", "url": "https://bitbucket.org/xxxx/xxxxx.git" } ], "require": { "xxxx/xxxxx": "dev-master" },
But I want to do this from the command line so that I can add this non-public repositories in a provision file. Packages registered at Packagist I can add with:
composer require ....
But how to handle this with repositories not registered at Packagist?
You can run the following from the project root to add a repository to the project's composer.json:
composer config repositories.repo-name vcs https://github.com/<orgname or username>/repo
Then you can require the specific repo with:
composer require <orgname or username>/repo:dev-branchname
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With