Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

github and composer. pulling repository branches

Composer cannot find the branch I want to clone from in the respository supplied in my json file. the error I get is:

 [UnexpectedValueException]
 Could not parse version constraint development: Invalid version string "dev
 elopment"

I assume I cannot say, go to this location, clone from this branch?

{
    "repositories": [
        {
            "type":"package",
            "package": {
                "name": "AdamKyle/Aisis-Core",
                "version":"development",
                "source": {
                    "url": "https://github.com/AdamKyle/Aisis-Core.git",
                    "type": "git",
                    "reference":"development"
                }
            }
        }
    ],
    "require": {
        "AdamKyle/Aisis-Core": "development"
    }
}
like image 628
LogicLooking Avatar asked Sep 20 '13 14:09

LogicLooking


1 Answers

You've just got the syntax wrong. You need to tell Composer to use a branch and then the branch name. So instead of:

"require": {
    "AdamKyle/Aisis-Core": "development"
}

assuming your branch is called 'development' it should be

"require": {
    "AdamKyle/Aisis-Core": "dev-development as 2.0.0"
}

The 2.0.0 to the right of the 'as' is the alias that your branch will be aliased to. This allows Composer to treat your branch as satisfying any other requirement for AdamKyle/Aisis-Core in the project with your branch version as version 2.0.0.

like image 77
Danack Avatar answered Sep 22 '22 00:09

Danack