Composer pull dependency from another branch on the same repo

ε祈祈猫儿з 提交于 2019-12-10 19:12:51

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!