Php 如何在GitHub中使用fork

Php 如何在GitHub中使用fork,php,github,zend-framework2,composer-php,Php,Github,Zend Framework2,Composer Php,我想更新GitHub中的回购协议,使其与ZF3兼容,我已将存储库转移到我的帐户并进行了一些更新 这是我的叉子: 现在,要将其包含在我的代码库中,我将使用Composer: { "name": "My Project", "description": "", "license": "PRIVATE - ", "keywords": [ "" ], "homepage": "", "repositories": [

我想更新GitHub中的回购协议,使其与ZF3兼容,我已将存储库转移到我的帐户并进行了一些更新

这是我的叉子:

现在,要将其包含在我的代码库中,我将使用Composer:

 {
    "name": "My Project",
    "description": "",
    "license": "PRIVATE - ",
    "keywords": [
        ""
    ],
    "homepage": "",
    "repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/chateaux/zf-oauth2-doctrine"
        }
    ],
    "require": {
        "php": ">=5.4",
        "zendframework/zendframework": "^2.4",
        "doctrine/doctrine-orm-module": "~0.8",
        "doctrine/orm": "^2.4",
        "gedmo/doctrine-extensions": "^2.4",
        "zf-commons/zfc-rbac":"^2.5",
        "rwoverdijk/assetmanager": "^1.4",
        "zfcampus/zf-apigility": "^1.0",
        "zfr/zfr-cors": "^1.2",
        "hounddog/doctrine-data-fixture-module": "^0.0.4",
        "zfcampus/zf-oauth2-client": "dev-master",
        "api-skeletons/zf-oauth2-doctrine": "dev-master",
        "api-skeletons/zf-oauth2-doctrine-console": "^1.1",
        "chateaux/toolbox" : "dev-master"
    },
    "require-dev": {
        "zfcampus/zf-apigility-admin": "~1.0",
        "zfcampus/zf-development-mode": "~2.0",
        "zendframework/zend-developer-tools": "dev-master"
    }
}
但是,当我运行composer更新时,它似乎是从缓存中提取的,因此我无法获取更新的代码库:

$ php composer.phar update
You are running composer with xdebug enabled. This has a major impact on runtime performance. See https://getcomposer.org/xdebug
Warning: This development build of composer is over 60 days old. It is recommended to update it by running "composer.phar self-update" to get the latest version.
Loading composer repositories with package information
Updating dependencies (including require-dev)                               
  - Installing zfcampus/zf-oauth2-doctrine (1.0.3)
    Loading from cache

我做错了什么?

您应该将存储库的自定义分支添加到
composer.json
文件中的存储库数组中,并添加一个类型字段
git
,然后指向要与
dev-[branchname]
一起使用的分支(例如
patch-4
变成
dev-patch4
):

确保
patch-4
是自定义存储库中的现有分支

您可以找到有关此解决方案的更多信息

{
    "name": "My ZF2 application",
    "repositories": [
        {
            "type": "git",
            "url": "https://github.com/chateaux/zf-oauth2-doctrine.git"
        },
    ],
    "require": {
        ...
        "zfcampus/zf-oauth2-doctrine": "dev-patch-4",
        ...
    }
}