Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
编写器未能克隆git repo_Git_Composer Php - Fatal编程技术网

编写器未能克隆git repo

编写器未能克隆git repo,git,composer-php,Git,Composer Php,我正在尝试在我的私有GitLab存储库中获取模块的开发版本 根据我在中的发现,我的项目的composer.json是: { "repositories": [ { "type": "composer", "url": "https://git.amh.net.au" }, { "type": "package", "package": {

我正在尝试在我的私有GitLab存储库中获取模块的开发版本

根据我在中的发现,我的项目的composer.json是:

{
    "repositories": [
        {
            "type": "composer",
            "url": "https://git.amh.net.au"
        },
        {
            "type": "package",
            "package": {
                "name": "amh-framework/amh-framework",
                "version": "dev-develop",
                "type": "package",
                "source": {
                    "url": "git.amh.net.au:/var/opt/gitlab/git-data/repositories/amh-framework/amh-framework.git",
                    "type": "git",
                    "reference": "master"
                }
            }
        }
    ],

    "require": {
        "amh-framework/amh-framework": "dev-develop",
    }
}
但是当我运行
composer update
时,它会抛出一个RuntimeException:

Failed to execute git clone --no-checkout '' '/var/checkouts/reports/reporter/vendor/amh-framework/amh-framework' && cd '/var/checkouts/reports/reporter/vendor/amh-framework/amh-framework' && git remote add composer '' && git fetch composer                                                                                                                                                                                                                                                

fatal: repository '' does not exist
composer update-vvv
的输出为:

Resolving dependencies through SAT
Dependency resolution completed in 0.001 seconds
  - Installing amh-framework/amh-framework (dev-develop 4d135f4)
Executing command (CWD): git --version
    Cloning 4d135f4b01dc896ffc722d8e24cc106d38cb4602
Executing command (CWD): git clone --no-checkout '' '/var/checkouts/reports/reporter/vendor/amh-framework/amh-framework' && cd '/var/checkouts/reports/reporter/vendor/amh-framework/amh-framework' && git remote add composer '' && git fetch composer
Executing command (CWD): git --version
Failed: [RuntimeException] Failed to execute git clone --no-checkout '' '/var/checkouts/reports/reporter/vendor/amh-framework/amh-framework' && cd '/var/checkouts/reports/reporter/vendor/amh-framework/amh-framework' && git remote add composer '' && git fetch composer

fatal: repository '' does not exist
因此,它似乎确实要检查repo以获得最新的提交(4d135f4b01dc896ffc722d8e24cc106d38cb4602)——但克隆时失败了

我可以手动克隆该项目,因此它看起来不是权限:

git clone git.amh.net.au:/var/opt/gitlab/git-data/repositories/amh-framework/amh-framework.git
要解决此问题,我可以做些什么?

根据,您只需要:

{
    "require": {
        "amh-framework/amh-framework": "dev-develop"
    },
    "repositories": [ 
        {
            "type": "vcs",
            "url": "git@git.amh.net.au:/var/opt/gitlab/git-data/repositories/amh-framework/amh-framework.git"
        }
     ]
}
确保为版本使用实际分支

git clone ''
fatal: repository '' does not exist
在上面的示例中,似乎Composer正在尝试克隆一个不存在的存储库


git clone--无签出-->''问题在于存储库的排序-我们使用satis to作为私有包服务器。出于某种原因,satis说dev master分支是可用的,但不能正确地提供它(尽管它适用于标记)

通过更改文件,使git回购在satis之前列出,它可以:

{
    "repositories": [
        {
            "type": "vcs",
            "url": "git@git.amh.net.au:amh-framework/amh-test.git"
        },
        {
            "type": "composer",
            "url": "https://svn.amh.net.au:8002"
        }
    ],
    "require": {
        "amh-framework/amh-test": "dev-master"
    }
}

在我的例子中,这是因为我缺少git能够获取存储库的
auth.json
凭据,因为它们是私有的

比如:


这是您完整的composer.json文件还是您遗漏了什么?因为将其验证为json文件会给我带来两个错误。现在我已经完全封闭了对象,它工作得更好吗?是的,在删除第17行末尾的尾随逗号后工作得更好。那么,为什么它对你不起作用呢?如果我知道这一点,我就不会在这里问了——我仍然得到了错误——这就是我最初尝试的。在阅读了其他人的问题之后,我到达了我目前的尝试。
{
  "github-oauth": {
    "github.com": "personal-access-key"
  }
}