如何告诉作曲家使用我的叉子分支? [英] How to tell composer to use a branch of my fork?
本文介绍了如何告诉作曲家使用我的叉子分支?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在symfony2项目中,我使用的是 jms / serializer-bundle,并且其中一个依赖项存在问题,即 jms / metadata
库。我已经分叉了元数据库,并在 bugfix-doctrine-proxy
分支中包含了一个修复程序。
In a symfony2 project, I am using "jms/serializer-bundle" and I have an issue with one of its dependencies, namely the jms/metadata
libary. I have forked the metadata library and included a fix in the bugfix-doctrine-proxy
branch.
现在我是想知道如何告诉作曲家在需要依赖项时应该使用我的分支吗?
Now I am wondering how to tell composer, that it should use my branch when requiring the dependency?
序列化程序库的composer.json:
The composer.json of the serializer library:
{
"name": "jms/serializer",
"type": "library",
...
],
"require": {
"php": ">=5.3.2",
"jms/metadata": "~1.1",
"jms/parser-lib": "1.*",
"phpcollection/phpcollection": "~0.1",
"doctrine/annotations": "1.*"
},
...
}
我的symfony2-project composer.json:
My symfony2-project composer.json:
{
...
"repositories": [
{
"type": "git",
"url": "git@github.com:hauptsacheNet/metadata.git"
}
],
"require": {
"jms/serializer-bundle": "dev-master",
...
}
}
推荐答案
答案是使用分支别名:
{
"repositories": [
{
"type": "git",
"url": "git@github.com:hauptsacheNet/metadata.git"
}
],
"require": {
"jms/metadata": "dev-bugfix-doctrine-proxy-class as 1.1",
},
}
这篇关于如何告诉作曲家使用我的叉子分支?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文