问题
I have the following Composer 1.6.5 setup:
"require": {
"CRMPicco/GolfBundle": "dev-golf-bundle"
},
"repositories": [
{
"type": "git",
"url": "git@git.crmpicco.com:frontend/app.git"
}
],
On the origin of git.crmpicco.com:frontend/app.git there exists the main branch of master
and also a golf-bundle
branch. I want to have the contents of the golf-bundle
branch as a composer dependency in the /vendor
directory. When I run a composer update CRMPicco/GolfBundle
I get the following error:
Your requirements could not be resolved to an installable set of packages.
Problem 1 - The requested package crmpicco/golfbundle dev-golf-bundle exists as CRMPicco/GolfBundle[dev-master] but these are rejected by your constraint.
I have also flushed the cache and run dump-autoload:
composer clear-cache
composer dump-autoload --optimize
How can I configure composer to pull from the "golf-bundle" branch?
My composer.json
from the golf-bundle
branch:
{
"name": "CRMPicco/GolfBundle",
"type": "library",
"require": {
"php": ">=7.0",
"symfony/config": "~2.8.34",
"symfony/dependency-injection": "~2.8.34",
"symfony/http-kernel": "~2.8.34",
"chargebee/chargebee-php": "^2.0"
},
"autoload": {
"psr-4": {
"CRMPicco\\GolfBundle\\": ""
}
},
"extra": {
"symfony-app-dir": "app",
"symfony-web-dir": "web",
"symfony-assets-install": "relative"
}
}
来源:https://stackoverflow.com/questions/51493884/composer-pull-dependency-from-another-branch-on-the-same-repo