应该将composer.lock提交到版本控制吗? [英] Should composer.lock be committed to version control?

查看:130
本文介绍了应该将composer.lock提交到版本控制吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对在具有存储库的应用程序中使用的 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 ?

推荐答案

如果你更新你的libs,你也要提交lockfile。

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.

如果您提交更改,并且有人提取您的代码并更新依赖项,那么您的项目将被锁定到您正在使用的那些特定版本的库。 lockfile应该是未修改的。如果它被修改,它意味着你有一个新的版本的东西。

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆