B
B
Barmunk2020-08-27 22:53:45
git
Barmunk, 2020-08-27 22:53:45

What to do with vendor when switching branches?

There is a master branch with composer.json, composer.lock and vendor which is itself excluded from git.
Created a new branch, updated json and lock. As a result, Vendor has changed a lot and is no longer functional in the master branch.

Since I have to switch from branch to branch very often, this leads to a bunch of additional steps, either copying the vendor-backup folder, or running composer Install every time, which is incredibly annoying. Is there any easier way to solve this?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Stalker_RED, 2020-08-27
@Barmunk

Make several vendor_branchname folders, and instead of the vendor folder, a symlink to one of them.
When switching branches, change the symlink. This can be automated by writing a post-checkout hook , for example.

D
dmitriy, 2020-08-28
@dmitriylanets

if branches are fundamentally different, for example, master and develop,
then create two sites master.site.loc and develop.site.loc
and develop in parallel

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question