如何在 GitHub 中使用叉子
How to work on a fork in GitHub
我想更新 GitHub 中的存储库以使其与 ZF3 兼容,我已将存储库分叉到我的帐户并进行了一些更新。
这是我的叉子:https://github.com/chateaux/zf-oauth2-doctrine
现在要将其包含在我的代码库中,我正在使用 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"
}
}
然而,当我 运行 作曲家更新时,它似乎是从缓存中提取的,所以我没有得到更新的代码库:
$ 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
,然后指向要与 [=13 一起使用的分支=](例如 patch-4
变为 dev-patch4
):
{
"name": "My ZF2 application",
"repositories": [
{
"type": "git",
"url": "https://github.com/chateaux/zf-oauth2-doctrine.git"
},
],
"require": {
...
"zfcampus/zf-oauth2-doctrine": "dev-patch-4",
...
}
}
确保 patch-4
是您的自定义存储库中的现有分支。
您可以找到有关此解决方案的更多信息 on the first hit from Google。
我想更新 GitHub 中的存储库以使其与 ZF3 兼容,我已将存储库分叉到我的帐户并进行了一些更新。
这是我的叉子:https://github.com/chateaux/zf-oauth2-doctrine
现在要将其包含在我的代码库中,我正在使用 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"
}
}
然而,当我 运行 作曲家更新时,它似乎是从缓存中提取的,所以我没有得到更新的代码库:
$ 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
,然后指向要与 [=13 一起使用的分支=](例如 patch-4
变为 dev-patch4
):
{
"name": "My ZF2 application",
"repositories": [
{
"type": "git",
"url": "https://github.com/chateaux/zf-oauth2-doctrine.git"
},
],
"require": {
...
"zfcampus/zf-oauth2-doctrine": "dev-patch-4",
...
}
}
确保 patch-4
是您的自定义存储库中的现有分支。
您可以找到有关此解决方案的更多信息 on the first hit from Google。