PHPackages                             pingiun/fix-composer-conflicts - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. pingiun/fix-composer-conflicts

ActiveProject[Utility &amp; Helpers](/categories/utility)

pingiun/fix-composer-conflicts
==============================

Fix composer conflicts with less thinking

0.1.1(1y ago)24EUPL-1.2PHPPHP ^8.3CI passing

Since Jun 29Pushed 3mo agoCompare

[ Source](https://github.com/pingiun/fix-composer-conflicts)[ Packagist](https://packagist.org/packages/pingiun/fix-composer-conflicts)[ RSS](/packages/pingiun-fix-composer-conflicts/feed)WikiDiscussions main Synced today

READMEChangelog (2)Dependencies (8)Versions (3)Used By (0)

fix-composer-conflicts
======================

[](#fix-composer-conflicts)

Fix composer conflicts with some help.

Installation
------------

[](#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
-----

[](#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:

[![screenshot](./screenshot.png)](./screenshot.png)

If you need help with the single letter commands, you can type `?` and hit enter for help.

How does it work?
-----------------

[](#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
-------------------

[](#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!

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance68

Regular maintenance activity

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

369d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b91da1d20a682daa9e1f860d1e9686d625832f13f1d016b968bd9569f6e8f5d7?d=identicon)[pingiun](/maintainers/pingiun)

---

Top Contributors

[![pingiun](https://avatars.githubusercontent.com/u/1576660?v=4)](https://github.com/pingiun "pingiun (23 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StyleLaravel Pint

Type Coverage Yes

### Embed Badge

![Health badge](/badges/pingiun-fix-composer-conflicts/health.svg)

```
[![Health](https://phpackages.com/badges/pingiun-fix-composer-conflicts/health.svg)](https://phpackages.com/packages/pingiun-fix-composer-conflicts)
```

###  Alternatives

[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.7k38.9k](/packages/matomo-matomo)[laravel/framework

The Laravel Framework.

34.8k543.8M20.1k](/packages/laravel-framework)[composer/composer

Composer helps you declare, manage and install dependencies of PHP projects. It ensures you have the right stack everywhere.

29.5k196.2M3.1k](/packages/composer-composer)[drupal/core

Drupal is an open source content management platform powering millions of websites and applications.

21866.0M1.7k](/packages/drupal-core)[friendsofphp/php-cs-fixer

A tool to automatically fix PHP code style

13.5k251.2M25.2k](/packages/friendsofphp-php-cs-fixer)[kimai/kimai

Kimai - Time Tracking

4.8k9.0k1](/packages/kimai-kimai)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
