composer.lock 应该致力于版本控制吗? [英] Should composer.lock be committed to version control?
问题描述
我对在带有存储库的应用程序中使用的 composer.lock
有点困惑.
I'm a little confused with composer.lock
used in an application with a repository.
我看到很多人说我们不应该从存储库中.gitignore
composer.lock
.
I saw many people saying that we should not .gitignore
composer.lock
from the repository.
如果我在我的开发环境中更新我的库,我将有一个新的 composer.lock
但我将无法将它们更新到生产中,是吗?
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 ?
推荐答案
如果你更新你的库,你也想提交锁文件.它基本上表明您的项目被锁定到您正在使用的那些特定版本的库中.
If you update your libs, you want to commit the lockfile too. It basically states that your project is locked to those specific versions of the libs you are using.
如果您提交了更改,并且有人拉取了您的代码并更新了依赖项,则锁文件应该是未修改的.如果它被修改了,就意味着你有一个新版本的东西.
If you commit your changes, and someone pulls your code and updates the dependencies, the lockfile should be unmodified. If it is modified, it means that you have a new version of something.
将它放在存储库中可以确保每个开发人员都使用相同的版本.
Having it in the repository assures you that each developer is using the same versions.
这篇关于composer.lock 应该致力于版本控制吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!