Download the PHP package yisraeldov/composer-subtree-plugin without Composer
On this page you can find all versions of the php package yisraeldov/composer-subtree-plugin. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download yisraeldov/composer-subtree-plugin
More information about yisraeldov/composer-subtree-plugin
Files in yisraeldov/composer-subtree-plugin
Package composer-subtree-plugin
Short Description Composer plugin for safer git subtree workflows
License MIT
Homepage https://github.com/yisraeldov/composer-subtree-plugin
Informations about the package composer-subtree-plugin
⚠️ 🤖 💩 Made with lots of AI help, so use at your own risk
composer-subtree-plugin
A Composer plugin that adds practical Git subtree commands to your PHP project.
Implemented today:
composer subtree:addcomposer subtree:pullcomposer subtree:push
What this project is
composer-subtree-plugin helps you manage subtree-based package workflows from Composer commands.
It stores subtree metadata on type=path repository entries in
composer.json.repositories[].composer-subtree-plugin and uses those
definitions for pull/push operations.
Why use this
This plugin is useful when your team has internal libraries that were previously pulled in through Composer vcs repositories, and that setup is causing friction in CI and deployment.
Common pain points with vcs internal dependencies:
- CI and deploy jobs depend on external repository availability and auth at install time.
- Build environments need extra SSH/token setup just to resolve private package sources.
- Reproducibility can become harder when dependency resolution and Git access are tightly coupled.
How this plugin helps:
- You vendor internal libraries as Git subtrees directly in your main repository.
- Composer installs from local code paths already present in the checkout.
- CI and deploy pipelines become simpler because subtree sync is an explicit step (
subtree:pull/subtree:push) instead of an implicit runtime dependency fetch.
Requirements
- PHP
^8.2 - Composer plugin API
^2.2 gitwithgit subtreeavailable
Installation
Install in the consumer project:
If your Composer setup requires explicit plugin approval, add:
Configuration format
Subtrees are configured on type=path repository entries:
Fields:
url(string): local subtree directory (path repository URL)remote(string): upstream repository URLbranch(string): upstream branchsquash(bool, optional): whether pull/add uses--squash(defaults tofalse)
Day-to-day usage
1) Add a new subtree
Example:
What it does:
- Runs
git subtree add --prefix=... <remote> <branch> [--squash] - Ensures
composer.json.repositoriescontains a path repository entry for the subtree prefix - Writes/updates subtree metadata at
repositories[].composer-subtree-plugin
Notes:
- If
prefixis omitted, default ispackages/<repo-name>. - Target selection is path-based (for example
packages/pcre) orall. - If the git command fails, config is not persisted.
2) Pull subtree updates
targetcan be a subtree path target (for examplepackages/pcre) orall.- If omitted, it behaves like
all.
Examples:
What it does per subtree:
git fetch <remote> <branch>git subtree pull --prefix=<prefix> <remote> <branch> [--squash]
3) Push subtree updates
targetcan be a subtree path target orall.- If omitted, it behaves like
all.
Examples:
What it does per subtree:
git subtree push --prefix=<prefix> <remote> <branch>
Current scope (implemented)
This plugin currently provides:
- Add subtree + persist subtree config
- Pull one/all configured subtrees
- Push one/all configured subtrees
No other subtree commands or update hooks are documented here because they are not implemented yet.
All versions of composer-subtree-plugin with dependencies
php Version ^8.2