I have a php project that uses composer for package management. One of the packages is another project belonging to the same repo. I have a need to commit my entire vendor folde
The entire vendor
folder should be ignored, not just the .git
sub-directories. Which packages are used are stored in composer.json
and composer.lock
which are what you check into version control.
See: https://getcomposer.org/doc/faqs/should-i-commit-the-dependencies-in-my-vendor-directory.md
If you want to create a reusable package as part of your project, you have two options:
Add to composer.json
...
{
"repositories": [
{
"url": "https://github.com/l3pp4rd/DoctrineExtensions.git",
"type": "git"
}
],
"require": {
"gedmo/doctrine-extensions": "~2.3"
}
}
You can create a packages
directory and add it to your autoload paths. This will let you use a single Git repo for all the code (if you want to use two repos, you can use a Git submodule)
Add to composer.json
...
"autoload": {
"classmap": ["packages"]
}