I’ve got own bundle “MyBundle” with composer.json:
{
"name": "mybundle",
"require": {
"propel/propel-bundle": "1.1.3",
"friendsofsymfony/user-bundle": "dev-master"
},
"autoload": {
"psr-0": { "": "src\" }
},
"target-dir": "MyBundle/"
}
When i’m trying to check it out with composer (“mybundle”: “dev-master”), everything is ok, but it’s on “no branch” branch.
How can i set a branch (“master”) for installed bundle?
That’s not possible due to the way composer installs work, and the fact it needs to be able to install specific versions of a branch. When you do that git ends up in a headless state.
If you need to work inside that installed bundle and push some commits just make sure you
git checkout masterbefore doing that. If you forgot and committed your changes you can also just checkout master and then merge the changes you did on to it.Update: Composer now checks out branches by name if the commit you checkout matches the last commit of the branch.