-2

Why composer cant install branch from https://github.com/wimvds/DoctrineMigrationsBundle/tree/feature/multiple-em-support ?

My composer.json:

"repositories": [
    {
        "type":"package",
        "package": {
          "name": "doctrine/doctrine-migrations-bundle",
          "version":"master",
          "source": {
              "url": "https://github.com/wimvds/DoctrineMigrationsBundle.git",
              "type": "git",
              "reference":"master"
            }
        }
    }
],
"require": {
(...)
        "doctrine/migrations": "1.0.*@dev",
        "doctrine/doctrine-migrations-bundle": "dev-feature/multiple-em-support",
(...)
}.

Error:

composer update

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - The requested package doctrine/doctrine-migrations-bundle dev-feature/multiple-em-support could not be found.

Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your minimum-stability setting
   see <https://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion> for more details.

Simplier way without "package" worked:

"repositories": [
    {
      "url": "https://github.com/wimvds/DoctrineMigrationsBundle.git",
      "type": "git"
    }
],
szymon Hab
  • 11
  • 1
  • 4
  • possible duplicate of [How to tell composer to use a branch of my fork?](http://stackoverflow.com/questions/25365957/how-to-tell-composer-to-use-a-branch-of-my-fork) – Francesco Casula Apr 29 '15 at 13:41

1 Answers1

1

Try this

"repositories": [
{

      "source": {
          "url": "https://github.com/wimvds/DoctrineMigrationsBundle",
          "type": "git",
        }
    }
}
],
"require": {
(...)
    "doctrine/migrations": "1.0.*@dev",
    "doctrine/doctrine-migrations-bundle": "dev-feature/multiple-em-support",
(...)
}
Smashou
  • 378
  • 1
  • 12
  • 1
    Just says "must have a type defined". I think "type" can't be in "source"? – mpen Jan 22 '16 at 23:15
  • 5
    Just a note for those still having issues. Notice the `dev-` before the branch name. That is not part of the branch name, its how composer knows its a branch and not a tag version. – lightswitch05 May 01 '19 at 13:26