使用fork而不是原始存储库



在许多情况下,我从一些存储库中创建了fork,以便更正错误或添加新功能。在这种情况下,当我进行PR时,主存储库背后的开发人员有时需要几天的时间来进行合并并测试是否一切正常,大多数时候我需要在热状态或执行时测试这些更改。

这就是SpBowerBundle的情况,它制作了一个叉子并修复了一些东西。我已经完成了PR,但我迫不及待地想让开发人员执行他们的测试并进行合并。唯一的解决方案是将composer.json指向我已经做过但不知道如何做的分叉。

这是分叉的存储库,这是我做出的承诺。作为补充,这里是我的composer.json内容:

{
    "name": "NewProject",
    "license": "MIT",
    "type": "project",
    "description": "NewProject",
    "autoload": {
        "psr-4": {
            "": "src/"
        }
    },
    "require": {
        "php": ">=5.3.3",
        "symfony/symfony": "2.5.*",
        "doctrine/orm": "~2.2,>=2.2.3",
        "doctrine/doctrine-bundle": "~1.2",
        "twig/extensions": "~1.0",
        "symfony/assetic-bundle": "~2.3",
        "symfony/swiftmailer-bundle": "~2.3",
        "symfony/monolog-bundle": "~2.4",
        "sensio/distribution-bundle": "~3.0",
        "sensio/framework-extra-bundle": "3.0.*@dev",
        "friendsofsymfony/user-bundle": "~2.0@dev",
        "friendsofsymfony/jsrouting-bundle": "2.0.*@dev",
        "friendsofsymfony/rest-bundle": "1.5.*@dev",
        "jms/serializer-bundle": "0.13.*@dev",
        "jms/di-extra-bundle": "1.4.*@dev",
        "jms/security-extra-bundle": "dev-master",
        "knplabs/knp-paginator-bundle": "2.4.*@dev",
        "knplabs/knp-menu": "2.0.*@dev",
        "knplabs/knp-menu-bundle": "2.0.*@dev",
        "stof/doctrine-extensions-bundle": "1.2.*@dev",
        "nelmio/api-doc-bundle": "2.7.*@dev",
        "genemu/form-bundle": "2.2.*@dev",
        "misd/phone-number-bundle": "~1.0",
        "liip/monitor-bundle": "dev-master",
        "raulfraile/ladybug-bundle": "~1.0",
        "sp/bower-bundle": "0.12.*@dev",
        "h4cc/alice-fixtures-bundle": "dev-bug/30-command-reference"
    },
    "require-dev": {
        "sensio/generator-bundle": "~2.3"
    },
    "scripts": {
        "post-root-package-install": [
            "SymfonyStandard\Composer::hookRootPackageInstall"
        ],
        "post-install-cmd": [
            "Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap",
            "Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache",
            "Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installAssets",
            "Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installRequirementsFile",
            "Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::removeSymfonyStandardFiles",
            "Liip\MonitorBundle\Composer\ScriptHandler::checkHealth"
        ],
        "post-update-cmd": [
            "Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap",
            "Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::clearCache",
            "Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installAssets",
            "Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::installRequirementsFile",
            "Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::removeSymfonyStandardFiles",
            "Liip\MonitorBundle\Composer\ScriptHandler::checkHealth"
        ]
    },
    "config": {
        "bin-dir": "bin"
    },
    "extra": {
        "symfony-app-dir": "app",
        "symfony-web-dir": "web",
        "branch-alias": {
            "dev-master": "2.5-dev"
        },
        "symfony-assets-install": "symlink"
    }
}

如何将我的作曲家指向分叉的存储库?处理这个问题的最佳方法是什么?

更新

在@Cerad建议我对composer.json文件进行了更改,但仍然没有从fork更新,我做错了什么?

"repositories": [
    {
        "type": "vcs",
        "url": "https://github.com/Spea/SpBowerBundle.git"
    }
],
"require": {
    ....
    "sp/bower-bundle": "dev-master",
},

将您的存储库添加到repositories,如果它有原始的composer.json,它应该使用它。

{
    ....
    "repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/paquitodev/SpBowerBundle"
        }
    ],
    ....
}

相关内容

  • 没有找到相关文章

最新更新