Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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

@DanyelMorales

This comment has been minimized.

Copy link

DanyelMorales commented Oct 24, 2016

Thanks a lot!!!, This was helpful.

@ndunks

This comment has been minimized.

Copy link

ndunks commented Sep 16, 2017

Great, helped a newcomers..
repositories type "path" work by creating junction instead copying whole project on windows 10

@Jaggle

This comment has been minimized.

Copy link

Jaggle commented Feb 27, 2019

thanks, helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.