Bruno Justino Praciano Bruno Justino Praciano - 2 months ago 16
PHP Question

How can I test/install an untagged version of a composer package?

I would like to test my private composer package on localhost without the need to commit a new tag to perform the test.

My package tree

├── composer.json
├── README.md
└── src
├── Controllers
│ 
├── Models

├── Providers
│   └── RouteGenericServiceProvider.php
├── Repositories

├── Routes
│   └── generics.php
├── Services
│ 
└── Transformers

Answer Source

As an alternative to what is suggested bey @Matteo, you can use an inline alias and reference a commit hash instead of a tag.

Assume that x.y.z is the version you have currently installed, and #123abc is the hash of the commit you would tag once successfully tested (probably HEAD of whatever the branch is you want to test), then run:

$ composer require "my/package:dev-master#123abc as x.y.z"

For reference, see: