本文介绍了如何要求作曲家的叉子?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的 composer.json,我想在 Github 上使用 Nodge 的 lessphp 项目分支

This 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"
},

但是当我运行 composer update 时出现此错误:

But I get this error when I run composer update:

点头/lessphp 开发大师->找不到匹配的包.

我不知道如何正确地要求这个 fork.

I don't know how to require correctly this fork.

推荐答案

最常见(也是最简单)的方法是使用 VCS 存储库.

The most common (and easiest) way of doing it is using a VCS repository.

您所要做的就是将您的 fork 添加为存储库并更新版本约束指向您的自定义分支.您的自定义分支名称必须dev-为前缀.

假设您修补了独白以修复错误修复分支中的错误:

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"
    }
}

请注意,除了指定错误修复分支外,您不会更改 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

这篇关于如何要求作曲家的叉子?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-03 17:35