sbuerk / checkout-path-repository
Composer plugin that registers local git checkouts listed in a manifest as path repositories, pins their versions and adds them as root requirements - optional checkouts that are missing are skipped.
Package info
github.com/sbuerk/checkout-path-repository
Type:composer-plugin
pkg:composer/sbuerk/checkout-path-repository
Requires
- php: ^8.1
- composer-plugin-api: ^2.3
Requires (Dev)
- composer/composer: ^2.3
- friendsofphp/php-cs-fixer: ^3.64
- phpstan/phpstan: ^2.0
- phpunit/phpunit: ^10.5 || ^11.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-09-26 23:48:46 UTC
README
A Composer plugin for development setups that work
on many packages at once: it installs a set of local git checkouts listed
in a manifest through path repositories
– and simply leaves out the checkouts that are not there.
- Manifest driven – one JSON file lists every package with its git
url,branchand theversionit should be installed as. - Optional checkouts – a checkout that is missing (for example a private
repository you have no access to) is skipped with a notice instead of
breaking
composer update. - Pinned versions – each checkout is installed as the manifest version,
independent of the branch that is checked out, so constraints like
~1.19.0@devbetween the checkouts resolve. - No hand-maintained requirements – present checkouts become root
requirements automatically;
composer.jsonis never rewritten. - Commands –
composer checkouts:cloneclones what is missing (without prompting, skipping inaccessible remotes),composer checkouts:statustells scripts whether acomposer updateis due (exit code3).
Quick start
packages/checkouts.json:
{
"packages": {
"vendor/library": {
"url": "git@github.com:vendor/library.git",
"branch": "main",
"version": "1.19.x-dev"
},
"vendor/extension": {
"url": "git@github.com:vendor/extension.git",
"branch": "5",
"version": "5.1.x-dev"
}
}
}
Root composer.json of the project that installs them:
{
"require": {
"sbuerk/checkout-path-repository": "@dev"
},
"extra": {
"sbuerk/checkout-path-repository": {
"manifest": "../packages/checkouts.json"
}
},
"config": {
"allow-plugins": {
"sbuerk/checkout-path-repository": true
}
}
}
composer update # installs the plugin itself composer checkouts:clone # clones missing checkouts next to the manifest composer checkouts:status || composer update # exit code 3: update needed
Important
Composer creates repositories before plugins are activated. The run that
installs the plugin cannot register the checkouts yet – the next
composer update does. composer checkouts:status exits with 3 in that
situation, see docs/limitations.md.
Requirements
- PHP 8.1+
- Composer 2.3+ (
composer-plugin-api: ^2.3) gitfor thecheckouts:*commands
Documentation
Details live in docs/:
- Installation
- Configuration & manifest
- Commands
- How it works (architecture)
- Limitations
- Development & testing
Contributing
Contributions are welcome – please read CONTRIBUTING.md.
License
Released under the GNU General Public License v2.0 or later.