I have one GIT-Repo with all my Modules inside. I want to use Composer to include them into my different projects. Is there a way to have them all in one git repo or do I need to create an own GIT-Repo for each Module?
You can only add collaborators to your repository. It cannot be "co-owned". The only way for doing what you want is to fork the repo and collaborate through pull requests. Note that you can create an organization ( https://github.com/account/organizations/new ) and achieve a bit of what you want.
Composer will look in all your repositories to find the packages your project requires. By default, only the Packagist.org repository is registered in Composer. You can add more repositories to your project by declaring them in composer. json .
A repository is a VCS term which describes when VCS is tracking a filesystem. In the scope of individual source code files, a VCS will track additions, deletions, modifications of the lines of text within that file. Popular software industry VCS options include Git, Mercurial, SVN and preforce.
It is a question of how conveniently easy you want to deal with the single modules.
If you are able to introduce a release process that is grabbing a single module from the shared repository, create a ZIP file from it, put that ZIP together with it's needed composer.json
meta data somewhere, host that ZIP via HTTP(S), and then make Packagist (or the local Satis repository you want to use) aware of that release... then you might use one single repository.
In all other cases, one repository per Composer package is the way to go.
Note that you can of course say "maxinet/random-collection-of-modules" as your only package. And at some later time, if you care enough, you could move parts of that module pack out into a single repository, and re-include it in the pack with composer.
The process of splitting a Git repository is described here: Detach (move) subdirectory into separate Git repository
You can use different branches of the same repository.
Then, require them in composer by
composer require vendor/repository-name:dev-branch-A
Prefix the branch name branch-A
with dev-
, if the branch is not tagged with a version.
I've seen your questions and didn't find an answer. So, I've a bit worked on this and implemented a simple package. I've customized satis to use this. https://github.com/andkirby/satis. So, create your satis.json and run:
$ composer require andkirby/satis --dev
$ vendor/bin/satis build satis.json .
Please read about the requirements by link https://github.com/andkirby/multi-repo-composer.
I hope it could help you!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With