首页 > 解决方案 > 作曲家不承认分叉回购包括

问题描述

我在尝试通过 Composer 将分叉的开源存储库包含到我的项目中时遇到问题。我已经在 Github 上创建了一个存储库,创建了一个分支,进行了相关更改,并试图通过我的 composer.json 文件通过以下方式包含它

...
"require": {
  ...
  "my-github-name/forked-repo-name": "dev-fix"
  ...
},
"repositories": {
    ...
    "8": {
        "type": "vcs",
        "url": "git@github.com:my-github-name/forked-repo-name.git"
    },
    ...

} ...

我尝试过包含不同的分支和版本号。这是一个 Magento 2 项目,我的 composer.json 文件当然有更多的东西,因此我添加的点来表示之前和之后的项目。

我收到以下作曲家错误:

The requested package my-github-name/forked-repo-name could not be found in any version, there may be a typo in the package name.

我正在使用 PHP 7.0.22

该存储库不是私有的,它似乎无法找到它。

谢谢

标签: composer-phpmagento2

解决方案


我强烈建议在这种情况下使用https而不是ssh

"url": "https://github.com/my-github-name/forked-repo-name.git"

推荐阅读