Yur Gasparyan
Yur Gasparyan

Reputation: 704

Gitlab private repository via composer

Today I have created private repository in gitlab and want to install it via composer in my laravel project, but when I run composer update I am getting the following error

Your configuration does not allow connections to ...........

Here is a part of my composer.json

"repositories": [{
        "type": "package",
        "package": {
            "name": "abc/def",
            "version": "dev-master",
            "type": "package",
            "source": {
                "url": "http://gitlab.abc.pro/abc/def",
                "type": "git",
                "reference": "master"
            },
        }
    } ],
"require": {
        "php": ">=5.5.9",
        "laravel/framework": "5.1.*",
        "abc/def" : "dev-master",  
    },

Upvotes: 3

Views: 9773

Answers (2)

Định Nguyễn Thế
Định Nguyễn Thế

Reputation: 203

You can use:

"repositories": [
    {
     "type": "vcs",
      "url": "ssh://[email protected]/repo/private.git"
    }
]

and this:

"require": {
    "php": ">=7.0.0",
    "repo/private": "dev-master",
 }

Upvotes: 12

Yur Gasparyan
Yur Gasparyan

Reputation: 704

For easy using gitlab repository I have used packagist service, so you need to go to settings of your gitlab repository and set oAuth token which have been taken from packagist. For using private repositories you need to get public and private keys and set it in gitlab repo.

Upvotes: 0

Related Questions