简体   繁体   中英

Composer: install package fork

I've forked a composer package so I can fix an issue with it and submit a PR to the maintainer.

Meanwhile, while it doesn't get merged, I want to use my version of the package in my projects. I've tried adding the repository information on composer.json but it always uses the regular package.

How can I force it to use my version? Do I have to rename the package?

Thanks in advance.

I've figured it out. I had a constraint on stable versions so it would not install a dev version and that was why it wouldn't read my fork.

Btw, no changes are required on the package's composer.json file. It treats it as the regular upstream package.

so, your forked package is on github for example. so, just use it:

composer.json:

"require": {
    "mygithub/blabla": 1.0
},
"repositories": [
        {
            "type": "vcs",
            "url": "git@github.com:mygithub/blabla.git"
        }
]

more info can be found here

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM