How to load private repository

Setup

Before you can load your private repository with composer, make sure you have setup
a composer.json file in your repository that contains at least a name. Also you need to setup atleast a tag.

From your local PC you need to have at least an SSH key matching your repository or user. Also, you should add the repository to your composer.json (because its private, right- how else should composer know about it?).
Something like this:

{
    require{
        "your-package-name-from-composer-json-in-gitlab": "*"
    },
    "repositories": [
        {
            "type": "vcs",
            "url":  "git@gitlab.com:vendor/your-package-name.git"
        }
    ]
}

And thats it. Enjoy!

Leave a comment

Your email address will not be published. Required fields are marked *