I have a big library that is hosted on Bitbucket as a private repository. I use this library for a lot of projects of mine.
I am having a trouble updating my library in each project where it's used whenever I do some changes, therefore I'd like to simply put it in the composer.json
file of each project, then use composer update
to pull the newest version.
How do I put my private repository which is hosted on Bitbucket in a composer.json
file without making it public?
First set up ssh for git: https://confluence.atlassian.com/bitbucket/set-up-ssh-for-git-728138079.html
In your composer.json of the project where you want to require the repository add the following:
Then in you can simply require it:
Note that the repository you are requiring should also have its own composer.json, the name set for the package there must match the name of the package you are including (vendor/projectname in my example above).