I'm using composer to organize my vendor libraries. One of these libraries is a private repository of general system classes.
The problem is that I want to have my code run out of the dev branch when it's on the dev environment, and automatically use the dev branch of my composer library. When the code is on staging, I want to use the staging branch and have composer switch to use the staging branch of the composer library. Same for production.
Is it possible for composer to pull the correct branch without having to manually switch to that branch or edit the composer.json file?
Edit: useful answer is the comments of accepted answer.