How to add non-public repositories from command line with composer?

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

The Composer documentation covers it at Modifying Repositories (CLI: composer config).

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)