How to force composer to reinstall a library?

Julian picture Julian · Oct 26, 2013 · Viewed 158.3k times · Source

I'm using the ZF2 skeleton app and it has a .gitignore that prevents external libraries from being commited to git. While debugging I like to go and change stuff here and there in the libraries' source to learn how things work. If these were version controlled it would be very easy to revert them back to their original state.

How can I force Composer to reinstall a particular framework so that I can get a fresh -unmodified- copy again?

PS: Please don't suggest removing the .gitignore file since it's there for a reason; it prevents my third party libraries from getting into my app's repository. I can always install them during an automated deployment.

Answer

Zoran picture Zoran · Aug 11, 2015

Just clear your vendors folder

rm -rf vendor/*