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

前端 未结 5 1155
一个人的身影
一个人的身影 2021-01-31 01:47

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 c

5条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-31 02:46

    For my case, all the 03 suggested solutions above from @Sven didn't work. This was my solution in case someone still struggling on a similar context.

    • remove existing usage if you have it composer remove the_vendor/the_package_name

    • If you have access to the package repo, create a 1st tag for it (eg: 0.1.0)

    git tag --annotate 0.1.0 --message "Initial version 0.1.0" 
    git push origin 0.1.0
    

    Note: Each time you update your package repo, pls attribute a new tag (eg: 0.1.1) & make composer update the_vendor/the_package_name on main app to update the composer.lock

    • If you don't have access to the package repo, pick existing tag version (not dev-master)

    • require it from main app composer require the_vendor/the_package_name:^0.1

    from master

提交回复
热议问题