Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Composer revert packages

I am building a new app in Symfony 2.1. I am using a lot of bundles pulled in using composer. A lot of these bundles have problems with this latest version of Symfony and I am having to go into the /vendor folder to identify the issues.

This means that I am changing the vendor files directly - purely for testing purposes. (When we have fixed a bundle we branch and submit appropriate pull request).

What I want to know is if there is some command like composer.phar revert which would undo any changes made to the vendor folder (like a git checkout). At the moment if I run a composer update or installit does not do this.

Thanks

like image 629
lopsided Avatar asked Jun 06 '12 14:06

lopsided


People also ask

How do I rollback a Composer?

Update and Revert Version To update the composer to the latest version, simply run the "self-update" command, and to revert back to the previous version do pass in the --rollback.

Can I downgrade Composer?

After performing any self-update , you can specify --rollback to go back to the previously installed version. Just want to add, if get permission error like me, then add "sudo" to run the cmd. Additional info: If you're inside of a version, you can change by using de specific version number.


2 Answers

composer install, if you have kept your composer.lock file, will revert all your vendors to the previously installed state.

like image 85
Seldaek Avatar answered Sep 17 '22 16:09

Seldaek


If you used composer update your composer.lock has changed to. So I make a little trick. Revert composer.lock by git and then run composer install. It'll remove newest packages and download the previous.

like image 39
R Picheta Avatar answered Sep 16 '22 16:09

R Picheta