When using Composer, you donβt have to worry about Git submodules at all.
On your local machine, you simply list your dependencies in your composer.json , and then run composer install . Now add composer.json and composer.lock to the project repository, but exclude the vendor directory in .gitignore .
Now, to deploy your project, simply clone or pull the project repository to your production server, and then run composer install again to install all the project dependencies.
When you make changes to your dependencies, you perform the same process again, including composer install on your local and production machines.
source share