Skip to main content

Command Palette

Search for a command to run...

Composer - How to require from github

Published
1 min read
Composer - How to require from github

By default composer will look up onto packagist.org, but what if we want to require the package / library from github repository instead of packagist.org?

to do that, we need to do 2 steps.

1. Configure The Configuration

First of all, we need to setup the configuration, so there's other pool for composer to look-up onto. It's the example of composer config for package of https://github.com/fiko/magento2-adminurl

composer config repositories.fiko-magento2-adminurl git git@github.com:fiko/magento2-adminurl.git

2. Require the package

Then, once composer config is complete, we just need to composer require package name that present on composer.json of that package. For the preceding example, we need to use this command :

composer require fiko/magento2-adminurl:dev-master

More from this blog

F

Fiko Borizqy (Bestafiko)

51 posts

I wrote these tutorials for myself in future when I forget for the next steps.