I have a PHP project where I use composer.
My own main library is actually a required package, as I'm also building a "standalone version" for people to install (not just the library), thus it lands in the vendor
directory.
Most of the time I spend developing the project happens in that vendor package, which is a Git clone already, however not on any branch. I can change that quickly enough by running git checkout master
. However, every time I run composer update
, it either complains about the directory being dirty, or checks out a new copy, where I have to start without being on a branch once more.
So, my question: is there some mode for Composer to e.g. only fetch the changes in that repo? Or what would be the preferred way to develop (or just contribute to) a vendor package at the same time as developing the main package?
As of a couple minutes ago composer updates will now ask you whether you want to revert the changes or do a stash/apply before/after the package update. This should help quite a bit with such problems, see https://github.com/composer/composer/pull/1188 for details.
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