通过composer克隆git仓库 [英] Clone git repository via composer

查看:97
本文介绍了通过composer克隆git仓库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

伙计们!我只是想通过作曲家克隆存储库.但不幸的是-我不能.

guys! I simply want to clone repository via composer. But unfortunately - i can't.

我的composer.json看起来像:

My composer.json looks like:

{
    "repositories": [
        {
            "type": "vcs",
            "url": "https://bitbucket.org/yuriikrevnyi/bitrix-teil-framework"
        }
    ],
    "require": {
        "mockery/mockery": "dev-master@dev",
        "phpunit/phpunit": "3.7.*"
    }
}

但是它不起作用.所以,你能不能帮我一下吗?

But its not going to work. So, couldnt you help me a little bit?

还有一个问题.如何与作曲家克隆"私人回购?可以说,我们有相同的仓库- https://bitbucket.org/yuriikrevnyi/bitrix-teil-framework.而管理员密码是-密码

And there is one more question. How to 'clone' private repo with composer? Lets say, we have same repo - https://bitbucket.org/yuriikrevnyi/bitrix-teil-framework. And admin password is - PASSWORD

那么,composer.json现在应该看起来如何?

So, how the composer.json should look now?

谢谢!

推荐答案

存储库部分仅用于定义packagist.org数据库中不存在的软件包,而这些软件包则位于源代码控制".

The respositories section is only to define packages that are not present in the packagist.org database, but it is present on a 'source control'.

因此,就像您在 composer.json 中告诉作曲家一样,有一个受源代码控制的软件包,以下是通过定义 url从中获取软件包的详细信息 ..等等

So, it is like you tell composer in your composer.json that there is a package which is source controlled, and here are the details where you get it from, by defining url .. etc.

但这还不够,因为这仅是定义,并不消耗(下载)软件包.为此,您还需要将其添加到您的require部分.

But that is not enough, because that is only definition and not consuming (downloading) the package. In order to do so, you need to add it to your require section as well.

{
  "repositories": [
    {
      "type": "vcs",
      "url": "https://bitbucket.org/yuriikrevnyi/bitrix-teil-framework"
    }
  ],
  "require": {
    "mockery/mockery": "dev-master@dev",
    "phpunit/phpunit": "3.7.*",
    "yuriikrevnyi/bitrix-teil-framework", "*"
  }
}

这篇关于通过composer克隆git仓库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆