When I run
php composer.phar update
composer complains that all of my libs are modified - even though I didn't touch them.
- Updating jdorn/sql-formatter (dev-master 3d8a973 => v1.2.9) The package has modified files: M lib/SqlFormatter.php
Note: I pulled the project from a remote repository.
Could it be that encoding messed up in the process?
How to fix this?
"even though I didn't touch them."
Well something did. If you think it wasn't you then it could be your IDE 'helpfully' reformatted it to your specified standards.
What you ought to do is:
Go into the directory vendors/jdorn/sql-formatter
Run the command git diff
That will show you what has actually changed. If it's just whitespace/code reformatting then it probably is your IDE that has 'helpfully' changed the files.
If it's an actual code change then it was probably yourself just not realising which file you were in.
If it's something else, then there could be another cause, but the git diff should allow you to figure out what it is.
The following answer seems to be the most complete one that I could find, it solved the problem (though not the source of the problem):
https://stackoverflow.com/a/24606663/667773
after
php composer.phar config --global discard-changes true
or after modifying composer.json
"config": {
"discard-changes": true
},
use
php composer.phar update -n
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With