Ignore composer.lock?

Hi everyone,

we’re using git to manage our OJS installations. During the upgrade process, one needs to run composer in several directories in order to create a composer.lock. My question is if i should version or ignore these composer.lock files. If they are to be ignored, maybe could this be added to the standard gitignore’s?

Best regards

Hi @dennmuel,

Standard “best practice” is to commit composer.lock to version control. That ensures that using composer install will reproduce the same environment every time. However, that practice is recommended for situations where many different users are pulling down the same code and wanting the same environment, which might not be your case. If you’re just using git as a local modification tracking tool, then it may not matter either way.

Alec Smecher
Public Knowledge Project Team

1 Like

Thank you very much, @asmecher!