Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@bigdawggi
Created February 7, 2017 23:44
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 bigdawggi/bb838dabb09fb101f1bf13466f576f93 to your computer and use it in GitHub Desktop.
Save bigdawggi/bb838dabb09fb101f1bf13466f576f93 to your computer and use it in GitHub Desktop.
Composer: How to reference local git repo's branch for development.

APP'S COMPOSER.JSON

....
"repositories": [
    { "type": "git", "url": "../email-library" }
],
"require": {
    "php": ">=5.6.4",
    "laravel/framework": "5.4.*",
    "laravel/tinker": "~1.0",
    "acme/php-email-library": "dev-test"
},
....

PACKAGE/LIBRARY FOLDER

(at relative path mentioned in "repositories" above)

Create a branch called test (not dev-test) and make your commits there, but don't need to push to a remote repo. Then you can run composer update from your app's folder, and it'll reference the latest commit from that branch.

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