Skip to main content
 首页 » 编程设计

github之Composer 包按分支

2025年05月04日102yjmyzz

我在GitHub中有一个 fork 的symfony存储库,并将一些代码推送到了 2.4 分支。
如何使Composer使用此特定分支?

composer.json:

"require" : { 
    ... 
    "symfony/symfony" : "dev-2.4" 
}, 
"repositories" : { 
    "type" : "vcs", 
    "url" : "https://github.com/tamirvs/symfony" 
} 

但是我得到 The requested package symfony/symfony dev-2.4 could not be found
我也尝试了 2.4-dev2.4,但是遇到了同样的错误。

我在网上找到的所有信息使我了解到我已经尝试过的方法。.有什么想法吗?

请注意,将版本设置为2.4。*时,存储库被拉出,但没有我的提交。

请您参考如下方法:

我认为您需要使用2.4.x-dev,如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.