0 votes
1 view
in Devops and Agile by (20k points)

I'm a little confused with composer.lock used in an application with a repository.

I saw many people saying that we should not .gitignore composer.lock from the repository.

If I update my libraries in my dev environment, I will have a new composer.lock but I will not be able to update them into production, will I?

Won't it generate conflicts on this file?

1 Answer

0 votes
by (28.4k points)
When you update your libs, you also want to commit the lockfile.

In other words, it states that your project is locked to those specific versions of the libs you are using.

But if you commit your changes, and then someone pulls your code and updates the dependencies, the lockfile should be unmodified.

That is the reason why having it in the repository assures you that each developer is using the same versions.
Welcome to Intellipaat Community. Get your technical queries answered by top developers !