为作曲家软件包创建差异补丁 [英] Create diff patch for a composer package
问题描述
我正在为一个很大的项目提供大量子模块,并使用 composer.json
存储库部分>等。
有时很容易在 vendor
目录而不是真实存储库中编辑文件(例如,有些子模块具有测试其他子模块的功能)。
I'm contributing to quite a large project with lots of submodules, and using repositories
section of composer.json
etc.
Sometimes it is handy to edit files in the vendor
directory instead of the real repository (e.g. there are some submodules with tests for the other ones).
然后我使用 composer update
并弹出一条消息:
放弃更改[y,n,v,d,s,?]?
Then I use composer update
and a message pops up:
Discard changes [y,n,v,d,s,?]?
我可以选择选项 d
,因此获得了一个不错的差异补丁,以后我可以将其用于真正的Git存储库。我可以用更简单的方式获得这样的补丁吗?
I can choose the option d
, thus getting a nice diff patch I can later use for the real Git repository. Can I have such a patch in a simpler way?
推荐答案
您可以转到依赖目录并使用git显示diff:
You can go to dependency directory and use git to show diff:
cd vendor/somevendor/somepackage
git diff HEAD
这是Composer的实际操作。
This is what Composer is actually doing.
这篇关于为作曲家软件包创建差异补丁的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!