0

I'd like to know how to install extensions on my Magento 2.1 using Github / Bitbucket / Gitlab with public and private repositories.

Thanks.

1 Answer 1

1

Public Github repository

Your custom branch name must be prefixed with "dev-".

{
    "repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/igorw/monolog"
        }
    ],
    "require": {
        "monolog/monolog": "dev-bugfix"
    }
}

Private Github repository

Exactly the same solution allows you to work with your private repositories at GitHub and BitBucket:

{
    "require": {
        "vendor/my-private-repo": "dev-master"
    },
    "repositories": [
        {
            "type": "vcs",
            "url":  "[email protected]:vendor/my-private-repo.git"
        }
    ]
}

The only requirement is the installation of SSH keys for a git client.

Reference here.


Using the CLI to install

composer config repositories.foo vcs https://github.com/foo/bar

After these commands run the command below in the root of your Magento 2 installation.

alias mage="php -d memory_limit=-1 -f bin/magento" &&
mage setup:upgrade && 
mage setup:upgrade && mage cache:flush

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.