pingiun/fix-composer-conflicts
Composer 安装命令:
composer create-project pingiun/fix-composer-conflicts
包简介
Fix composer conflicts with less thinking
README 文档
README
Fix composer conflicts with some help.
Installation
The easiest way to install is using composer global require.
composer global require pingiun/fix-composer-conflicts
Then you can find the tool in your composer home directory. Use this command to find out where it is:
composer global config home
You could add this directory (with /vendor/bin appended) to your PATH variable if you want to run it easily.
Bash single-liner if you're lazy:
echo 'export PATH="$PATH:$(composer global config home)/vendor/bin"' >> ~/.bashrc && source ~/.bashrc
Note, this tool requires PHP 8.3 or higher.
Usage
If you are doing a merge, rebase or cherry-pick and you get a git conflict in your composer.json file, you can use this tool to fix it.
Run the following command in the root of your project:
fix-composer-conflicts
You will get an interactive prompt like this:
If you need help with the single letter commands, you can type ? and hit enter for help.
How does it work?
After making your choices, the tool checks whether the ours version or the theirs version of the composer.json is closer to what you want.
Then it resets both the composer.json and composer.lock files to the ours version, and then applies any choices you made in the interactive prompt.
It applies the choices by literally just doing composer require commands in the background.
Afterwards it adds the composer.json and composer.lock files to the git index, so you can commit them right away.
Current limitations
The tool does not try to keep subdependencies locked as they were in the composer.lock file.
This is because it works by just re-requiring the tools, at which point composer will resolve the dependencies again.
This is something I will look into in the future, as it could lead to unexpected changes in the composer.lock file.
Another limitation is that every step is still manual, I'd like to have a way to automatically make choices. PRs are welcome for this!
pingiun/fix-composer-conflicts 适用场景与选型建议
pingiun/fix-composer-conflicts 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 4 次下载、GitHub Stars 达 2, 最近一次更新时间为 2025 年 06 月 29 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 pingiun/fix-composer-conflicts 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 pingiun/fix-composer-conflicts 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 4
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 14
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: EUPL-1.2
- 更新时间: 2025-06-29
