From time to time, you will find that you are going to need to work on a new feature, maybe your main application has some changes that live in your composer package or maybe you are adding a new feature to your compose package.
In both scenarios, you might be maintaining a couple of feature branches and would want to be able to check your work in your staging environment, at the very least not impact your team.
Luckily Composer makes this super simple.
Take the branch name and prepend dev-
to it as in the example below.
{
"require": {
"app/core": "dev-branch-name"
},
"repositories": [
{
"type": "package",
"package": {
"name": "app/core",
"version": "dev-branch-name",
"source": {
"url": "[email protected]:repo/app-core.git",
"type": "git",
"reference": "branch-name"
}
}
}
]
}
Maybe you want to check a specific commit, then try using a commit hash instead dev-master#99226c9
Thats it, and I hope this helps. I know it has come in handy when deploying a docker container to a staging server.