修改/vendor目录中的文件并将更改提交到composer.lock? [英] Modify files in /vendor directory and commit changes to composer.lock?
问题描述
我必须修改一个供应商软件包(avatarguru/mustache-l5
),该软件包与最新版本的Laravel 5(dev)框架不兼容.但是现在,当我在项目的根目录中执行composer status
时,它显示为No local changes
.我还尝试修改其他一些软件包-同样的事情...
I had to modify a vendor package (avatarguru/mustache-l5
), which was not compatible with the latest version of Laravel 5 (dev) framework. But now when I do composer status
in the project's root directory, it shows No local changes
. I also tried to modify some other packages - same thing...
我如何将更改提交到composer.lock,以便其他开发人员不必再次修复相同的软件包?
How do I commit that changes to composer.lock, so that other developers will not have to fix same packages again?
推荐答案
您应该派生该软件包,使用所做的更改创建一个自定义存储库-然后将其包含在您的composer.json
中.
You should fork the package, create a custom repo with your changes - then include that in your composer.json
.
{
"repositories": [ {
"type": "vcs",
"url": "https://github.com/YourGithubUsername/PackageName"
}
}],
"require": {
"laravel/framework": "4.0.*",
"OriginalVendor/PackageName": "1.0.*"
},
}
这样,您可以随时提取自定义更改,而不必将其提交到特定项目.
That way you can pull your custom changes in anytime, without having to commit it to your specific project.
您可以在此处了解有关分叉和加载软件包的更多信息: https://getreferrer.org /doc/05-repositories.md#vcs
You can read more about forking and loading packages here: https://getcomposer.org/doc/05-repositories.md#vcs
这篇关于修改/vendor目录中的文件并将更改提交到composer.lock?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!