如何要求一个叉子与作曲家 [英] How to require a fork with composer
问题描述
这里是我的composer.json,我想在Github上使用Nodge的fork的lessphp项目
here is my composer.json, i want to use Nodge's fork of lessphp project on Github
"repositories": [{
"type": "package",
"package": {
"version": "dev-master",
"name": "nodge/lessphp",
"source": {
"url": "https://github.com/Nodge/lessphp.git",
"type": "git",
"reference": "master"
},
"autoload": {
"classmap": ["lessc.inc.php"]
}
}
}],
"require": {
"php": ">=5.3.3",
"nodge/lessphp": "dev-master"
},
但我有更新时出现这个错误:
But i have this error when i make update :
nodge / lessphp dev-master - >找不到匹配的包。
nodge/lessphp dev-master -> no matching package found.
不知道如何正确地要求它这个叉子...
I don't know how to require it correctly this fork...
有什么建议吗?
推荐答案
最常用的方法是使用VCS库。
The most common (and easier) way of doing it is using a VCS repository.
do是添加你的fork作为一个存储库,并更新
版本约束指向你的自定义分支。您的自定义分支
名称必须以dev -
作为前缀。
All you have to do is add your fork as a repository and update the version constraint to point to your custom branch. Your custom branch name must be prefixed with
dev-
.
示例假设您修补monolog修复bug修复分支中的错误:
Example assuming you patched monolog to fix a bug in the bugfix branch:
{
"repositories": [
{
"type": "vcs",
"url": "https://github.com/igorw/monolog"
}
],
"require": {
"monolog/monolog": "dev-bugfix"
}
}
请注意,除非指定您的bugfix分支,否则不要更改require语句。您仍然引用上游套件( monolog / monolog
),不是您的个人货叉( igorw / monolog
)。您可以阅读文档中的详细信息
Note that you don't change the require statement except to specify your bugfix branch. You still reference the upstream package (monolog/monolog
), not your personal fork (igorw/monolog
). You can read details in the docs
这篇关于如何要求一个叉子与作曲家的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!