Composer package by branch
-
26-12-2019 - |
Question
I have a forked symfony repository in GitHub and I pushed some code to the 2.4 branch. How can I make Composer use this specific branch?
composer.json:
"require" : {
...
"symfony/symfony" : "dev-2.4"
},
"repositories" : {
"type" : "vcs",
"url" : "https://github.com/tamirvs/symfony"
}
But I get The requested package symfony/symfony dev-2.4 could not be found
.
I've also tried 2.4-dev
and 2.4
but I get the same error..
All the info I found on the web got me to what I've already tried.. any ideas?
Please note, that when setting the version to 2.4.* the repository is pulled but without my commits..
Solution
I think you'll need to use 2.4.x-dev
, as outlined in the documentation.
For example a branch 2.0 will get a version 2.0.x-dev (the .x is added for technical reasons, to make sure it is recognized as a branch, a 2.0.x branch would also be valid and be turned into 2.0.x-dev as well.
OTHER TIPS
Try 2.5-dev.
I believe that the branch has got that version number.
EDIT:
Take a look at https://github.com/tamirvs/symfony/blob/master/composer.json
"extra": {
"branch-alias": {
"dev-master": "2.5-dev"
}
}