I have installed third party module with composer and we are managing code with Git.Since Module is installed with composer so it is going to Magento Vendor Folder.In git we are ignoring Vendor Folder.Hence this module is not tracked in Git while running git status.I am able to see modified in two files

"modified:   composer.json
modified:   composer.lock

My question is how I can install this module on server?Should I add and commit both modified files in git and run command composer update(but it will update whole magento) Or should I track that module in vendor folder in .gitignore file?

Please suggest me your thoughts.


1 Answer 1


Yes you would commit both the composer.json and composer.lock files.

As part of your deployment process to the live environment you would need to run composer install - this takes the information stored in the composer.lock file and recreates the very same versions you had installed locally.

  • can you please tell me the reason why module go to Vendor directory when install using composer? May 29, 2019 at 13:20
  • @iqbalmalik installing to vendor is the normal Composer behaviour. As to the reason for it you would need to check with the creators of Composer. May 30, 2019 at 8:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.