#12078·composer

dev-main found instead of dev-master

Author: iranimijCreated Aug 6, 2024Updated Jul 23, 2026

In 2021 there was an issue https://github.com/composer/composer/issues/10360 and the fix for this issue made an exact opposite issue for us, we have dev-master and now composer just found dev-main

My composer.json:

json
{
    "name": "foobar/project",
    "type": "project",
    "require": {
        "foobar/package": "dev-master"
    },
    "repositories": {
        "foobar/package": {
            "type": "path",
            "url": "/path/to/package/"
        }
    }
}

/path/to/package/composer.json

json
{
    "name": "foobar/package",
    "type": "library"
}

Output of composer diagnose:

$ composer update
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires foobar/package dev-main, found foobar/package[dev-master] but it does not match the constraint.

When I run this command:

composer update foobar/package

I get the following output:

$ composer update
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires foobar/package dev-master, found foobar/package[dev-main] but it does not match the constraint.

And I expected this to happen: I expect it to work fine without any errors

there was a fix here to have aliases for branches I do not know why it is removed here : and when we are removing a PR changes I expect to revert everything, in the previous PR it is changed to dev-main and when we removed the changes we didn't move it back to dev-master!