Bitbucket
-
At Bitbucket, click on your avatar in the bottom left corner and choose a workspace.
-
In the left menu, click Settings icon and then choose Apps and features → OAuth consumers and click the button Add consumer.
-
Fill in the name, callback URL with http://example.com, check This is a private consumer and under Permissions select Projects → Read.
-
Click Save.
-
Click the consumer name to expand the entry and copy Key and Secret.
Adding to composer
Add the consumer key and secret to composer's configuration:
$ composer config --global bitbucket-oauth.bitbucket.org [consumer-key] [consumer-secret]
You can list your composer's configuration:
$ composer global config --list
In composer.json, add the repo as a repository:
"repositories": [
...
,{
"type": "vcs",
"url": "https://bitbucket.org/vendor/package-name.git"
}
...
}
Install the package
That's it, now you can composer require vendor/package-name
to pull your repo.