Skysplit Skysplit - 3 months ago 9
Git Question

Checkout to another branch with different composer dependencies

So lately I've been developing composer package and I ran into following problem.

Branch

1.0
had composer dependency on
somepackage: 1.0.0


Branch
2.0
had composer dependency on
somepackage: 2.0.0


Is it possible to switch between these two branches without removing
vendor
directory and
running
composer update
each time after
git checkout {branch}
? If so, how can I do this?

Answer

As it is stated in the documentation, composer.lock is supposed to be committed to repository. I'm afraid you're trying to solve a problem, just because of wrong usage of composer.

Comments