Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I get Composer to download the latest commit in the master branch from GitHub for a package?

I am trying to get Composer do download the latest commit for the Behat/MinkSelenium2Driver package. That particular repo only has a master branch. I have tried every method I can think of, including deleting the files and letting it pull them back in, to get it to work but it doesn't.

How would I get it to pull in latest committed files or at least those from the commit I list below?

Specifically I want to get this commit: https://github.com/Behat/MinkSelenium2Driver/commit/2e73d8134ec8526b6e742f05c146fec2d5e1b8d6

Thanks, Patrick

like image 331
Patrick Avatar asked Nov 11 '13 21:11

Patrick


People also ask

Where does Composer get packages from?

Composer downloads directly from the source, e.g. Packagist only knows those source and tells your composer instance where to go. It does this by downloading a bunch of json files from Packagist.org that have all the infos.

How do I add a repository to composer?

You can add more repositories to your project by declaring them in composer. json . Repositories are only available to the root package and the repositories defined in your dependencies will not be loaded.

What is Dev master in composer?

The dev-master branch is one in your main VCS repo. It is rather common that someone will want the latest master dev version. Thus, Composer allows you to alias your dev-master branch to a 1.0.x-dev version.


1 Answers

There is only one way to grab the head of the repository:

"require": { "behat/mink-selenium2-driver" : "dev-master" } "minimum-stability": "dev" 

Oh well, at least two ways:

"require": { "behat/mink-selenium2-driver" : "dev-master as 1.1.x-dev" } "minimum-stability": "dev" 

Probably at least three ways:

"require": { "behat/mink-selenium2-driver" : "dev-master#2e73d8134ec8526b6e742f05c146fec2d5e1b8d6" } "minimum-stability": "dev" 

Because that repository actually aliased the master branch as 1.1.x-dev, this would also work without the minimum-stability affecting all other packages:

"require": { "behat/mink-selenium2-driver" : "1.1.*@dev" } 
like image 70
Sven Avatar answered Sep 23 '22 21:09

Sven