Home >Development Tools >composer >The use of composer.lock under composer and how to delete it

The use of composer.lock under composer and how to delete it

藏色散人
藏色散人forward
2021-02-10 09:41:244141browse

The following tutorial column of composer will introduce the use of composer.lock under composer and how to delete it. I hope it will be helpful to friends in need!

The use of composer.lock under composer and how to delete it

When you use composer to install php components, you will find that a composer.lock file is created. What does this do??

composer.lock records the versions of all currently installed PHP components. If multiple people need to keep the version of the downloaded PHP components during collaborative development to reduce unnecessary trouble, then composer.lock needs to be added to version control. , such as using git or svn, then you need to add it to version control.

No need to do otherwise.

It should be noted that when composer installmakes component dependencies, the composer.lock file will not be updated unless new components are introduced into composer.json. If you want to update Please use composer update will update the component to the latest stable version and also update the latest composer.lock file.

How to delete COMPOSER.LOCK gracefully

Refresh the composer.lock file

composer update nothing

or

composer update --lock

The above is the detailed content of The use of composer.lock under composer and how to delete it. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:csdn.net. If there is any infringement, please contact admin@php.cn delete