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

Patrick picture Patrick · Nov 11, 2013 · Viewed 37.4k times · Source

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

Answer

Sven picture Sven · Nov 11, 2013

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" }