Add Composer Package from GitHub Repository Using VCS Method
A new blog post by jofitz explains how to add a Composer package directly from a GitHub repository—a common need for private or in-development packages not published on drupal.org or Asset Packagist. The method relies on using a vcs repository type in composer.json.
Developers can either add the repository entry manually or via command line using composer config. Once set, the package is installed with the standard composer require command. The tutorial highlights that the package name comes from its own composer.json, which may differ from the repo name.
The post cautions that editing VCS packages directly introduces risks: they won’t stay in sync with composer.lock, which can lead to inconsistencies or lost changes. Composer may warn about unsaved modifications, but version control hygiene remains essential.
While the example uses GitHub, the same process applies to GitLab and Bitbucket repositories. For more details, see the full guide on jofitz.co.uk or refer to the official Composer VCS repository documentation.

