Skip to content

Instantly share code, notes, and snippets.

@saber13812002
Forked from ziadoz/composer_path.json
Created June 30, 2021 04:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save saber13812002/7c9992e3b409680da9f22e08a29c2981 to your computer and use it in GitHub Desktop.
Save saber13812002/7c9992e3b409680da9f22e08a29c2981 to your computer and use it in GitHub Desktop.
Composer Using Local Repositories and Branches
{
"repositories": [
{
"type": "path",
"url": "../relative/project/path"
}
],
"require": {
"${project}": "dev-${branch}"
}
}
{
"repositories": [
{
"type": "vcs",
"url": "/absolute/project/path"
}
],
"require": {
"${project}": "dev-${branch}"
}
}

Notes

You can pull in a local project (e.g. for testing changes) using either vcs or path repository types in Composer:

VCS

Put the path to the local project VCS (Git, Hg, SVN etc) in the url field.

See: composer_vcs.json

Path

Put the relative path to the local project in the url field.

See: composer_path.json

Branch

Prefix the branch name you want to use with dev-, so my-branch becomes dev-my-branch.

Links

Install a Local Package with Composer

Using a Branch as a Dependency in Composer

Composer Path Repositories

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment