What's the right way to change version number when using composer
? Consider the current scenario:
You have master
and develop
branches and your version is 1.0.0
. A critical bug appears and you have to create a hotfix-1.0.1
branch (from master) to fix it and merge back to both master
and develop
. Once you're about to merge, you update "version":"1.0.1"
inside composer.json
.
Now what? in my case I ran composer update
and several dependencies where updated (which was not the reason I ran it, I just thought it was mandatory to run it every time composer.json changes), which ended up in a 1 hour conflict-resolving on composer.lock
when merging branches.
Do I have to run composer update
(or any other composer command) after updating "version"
or that is not necessary and I can just git commit
and git push
?
There is no need to run
composer update
when you update your own version number. Only run it when you want to update dependencies:I strongly recommend explicitly listing the dependencies you wish to update: