Avoiding Composer Cancellation Message

I am updating symfony verdors through composer. I always do this using:

php composer.phar update 

But a recent version of the composer, before updating each package will show the following message:

  - Updating doctrine/data-fixtures dev-master (a95d783 => a28b6bd) The package has modified files: M .gitignore M .gitmodules M LICENSE M README.md M UPGRADE M composer.json M lib/Doctrine/Common/DataFixtures/AbstractFixture.php M lib/Doctrine/Common/DataFixtures/DependentFixtureInterface.php M lib/Doctrine/Common/DataFixtures/Event/Listener/MongoDBReferenceListener.php M lib/Doctrine/Common/DataFixtures/Event/Listener/ORMReferenceListener.php 

-10 more modified files, select "v" to view the full list Discard changes [y, n, v, s ,?]?

How to avoid this?

+22
php composer-php
Nov 28 '12 at 20:14
source share
4 answers

Set composer configuration to discard changes. (see https://github.com/composer/composer/pull/1188 ):

 php composer.phar config --global discard-changes true 
+30
Sep 15 '13 at 12:04 on
source share

both @lemats and @ reza-sanaie answers are incomplete since the -no-interaction (-n) option is required to have a real update without any questions (see https://github.com/composer/composer/pull/ 1188 # issuecomment-16011533 ).

So after

 php composer.phar config --global discard-changes true 

or after changing composer.json

 "config": { "discard-changes": true }, 

using

 php composer.phar update -n 
+26
Jul 07 '14 at 8:57
source share

Alternatively for the @lemats solution, you can modify the composer.json file with:

  "config": { "discard-changes": true }, 

It is not worth using anything for this option, you should work in --no-interaction mode

php composer.json install --no-interaction

Although I agree with @Seldaek, you should not modify these vendor files, but sometimes you are forced to decapitate it :(

+16
Nov 26 '13 at 22:46
source share

How not to change provider files? If they are modified, most likely due to some corrupted git parameters for line endings. See https://help.github.com/articles/dealing-with-line-endings

0
Nov 29 '12 at 10:09
source share



All Articles