Symfony2: How to update a bundle whose source files have been modified?

2.1k views Asked by At

I am using the KNP Pagination Bundle. I customized the twig file in the bundle source. Then I found a better way of doing it without touching the bundle's files.

Unfortunately, now everytime that I do

bin/vendors install

I get the following error:-

"KNP Paginator Bundle" has local modifications. Please revert or commit/push before running this command again.

My .gitignore file has ignored /vendors

And my deps file has the bundle included too.

Is there a way to uninstall a bundle? So that I can reinstall it? Or what is the best way to solve my problem?

2

There are 2 answers

1
Anton Babenko On

./bin/vendors doesn't care about content of .gitignore. You can fork desired bundle, do your changes there and change deps file to point to your fork instead.

If you still want to use original bundle and just reinstall it, you can either run ./bin/vendors install --reinstall or just delete the bundle folder from vendor directory and run ./bin/vendors install again.

0
Nikola Petkanski On

How about using git --reset? The vendors are fetched using git clone after all.

Can you explain what "git reset" does in plain english?