Search code examples
gitgithubcomposer-phppackagist

Packagist prefixes branch names with dev-


Packagist.org prefixes my branches with 'dev-' which I don't wan't it to do, since I've a dev-master and a master branch in my repo. Any trick to not have it prefixed?

Packagist page

Github repo


Solution

  • You don't need to create a dev-master any* branch as branches will automatically appear as "dev" versions in Packagist.

    *any branches except branches named like versions (e.g. if the branch name is 2.0)

    New versions of your package are automatically fetched from tags you create in your github repository.

    So if you specify a version when you require your package it fetches from the master branch the latest tagged version. e.g. "acme/package": "3.2.x" takes the latest 3.2 tagged version from the master branch.

    If you need the latest dev version which is still untagged in your master branch then you can require dev-master in the composer.json. E.g. "acme/package": "dev-master" which fetches the latest commit from your master branch.

    For more Info see: https://packagist.org/about#managing-package-versions or https://getcomposer.org/doc/02-libraries.md#branches