Skip to content
ReviewRamble

The weekly brief

AI, reviewed, in your inbox.

  • New reviews of tools, models, MCP servers and repos, with the verdict up front
  • Re-checked prices and ratings when something changes
  • New analysis pieces as they are published

Models, agents, MCP servers and the tools actually worth your time.

One email a week. Unsubscribe with the link in any brief. How we use your email

Mergiraf

A Git merge driver that parses both sides of a conflict and settles the ones that only clash line by line. Rust, GPL-3.0, on Codeberg.

Reviewed by ReviewRamble editors · Updated

Source code Open source

Share this page:XLinkedInFacebookRedditWhatsAppEmail

Our rating

4.1/5

Mergiraf removes a good share of the merge conflicts that were never real, cautiously enough to trust as a default, but it will not touch the hard ones and C code gains least.

What is Mergiraf?

Mergiraf is a merge driver for Git: a program Git calls when two branches change the same file. It first tries Git's ordinary line-based merge and, if that comes out clean, returns it unchanged. When lines conflict, it parses the base, left and right versions with tree-sitter, matches their syntax trees with the GumTree algorithm and tries to combine changes that touch different parts of the code. Two branches adding different fields to the same Java class, or one changing a C function's argument type while the other changes its return type, are merged without markers. Where order matters, as with two new statements in the same block, it leaves a conflict for a person.

It supports 30 programming languages, including Rust, Python, Go, TypeScript, Java and C/C++, and 11 file formats such as JSON, YAML, TOML, HCL and go.mod. It also catches a mistake plain Git makes: a clean line merge that leaves the same JSON key twice is turned back into a conflict. It works as a registered merge driver (so it also runs during rebase, cherry-pick and revert), as a command run after a conflict, or with Jujutsu through jj resolve --tool mergiraf.

Antonin Delpeuch started it in October 2024, and it is written in Rust under GPL-3.0. The project lives on Codeberg, not GitHub, so its star count (486) is Codeberg's and looks small next to GitHub projects of similar standing; the crate has about 30,000 downloads on crates.io. The latest release is v0.20.0, from 26 September 2026, and commits landed as recently as 21 November.

Is Mergiraf worth it?

Many merge conflicts are not real disagreements. Two people added an import at the same spot, or one reformatted a function while the other renamed a parameter, and Git, which compares lines, cannot tell. Mergiraf compares syntax trees instead, and the design is careful about when it acts. It only steps in after Git's own merge has failed, it falls back to a line merge if any version fails to parse, and when it does settle a conflict on its own it asks you to check the result with mergiraf review. Setting mergiraf=0 in the environment turns it off for a single command.

The numbers are honest about its reach. In an October 2025 LWN article, the author described replaying the 7,415 Linux kernel merge commits that conflict under Git's default merge: Mergiraf fully resolved 428 and left the rest with conflicts, many of them partly solved. C is a hard case because macros defeat the parser, and one LWN commenter found the success rate on C too low to bother with. The docs give stronger examples in Java, Rust, JSON and YAML, where items such as class fields or map keys can be listed in any order, and users on Lobsters say it handles their YAML and go.mod conflicts without fuss.

The complaints are about edge cases and speed. One Lobsters user finds it can be slow, sometimes timing out before handing back to Git; a Jujutsu user says jj resolve --tool mergiraf works about half the time; another says a modify/delete conflict can leave the file in place without markers, so the conflict is easy to miss. Commenters on Hacker News and LWN also make the broader point that a clean merge can still be a wrong program, which no merge driver can fix. Tests still have to run after the merge.

Upkeep looks healthy. Four releases came out between July and September 2026, and v0.20.0 added QML, compiled tree-sitter queries once per parse for speed and credited three first-time contributors. The cost of being on Codeberg is mostly discoverability: there is no GitHub repository to star, issues go to Codeberg and questions to Zulip, and macOS users get binaries through Homebrew.

Our take: register it globally and leave it on. In the common case Git's own merge succeeds first, so it costs almost nothing and changes nothing; in the cases it handles it saves a trip through a conflict editor, and it says so when it has acted. Teams that keep long-lived forks in sync with upstream will notice the difference most.

Where it earns its place

  • A platform engineer maintaining an internal fork of a fast-moving open-source project

    Rebase the fork onto upstream every week without spending an afternoon on import and field-order conflicts

    Register Mergiraf as a global merge driver and add * merge=mergiraf to the global attributes file. During the weekly rebase it settles conflicts where both sides added different imports, struct fields or map keys, and leaves ordering conflicts in function bodies marked for a person. Run mergiraf review on anything it resolved alone.

  • An infrastructure team keeping Terraform and Kubernetes YAML in one repository

    Stop parallel changes to the same HCL or YAML file from blocking merges

    Enable it per repository with lines such as *.tf merge=mergiraf and *.yaml merge=mergiraf in .gitattributes, so only those files use it. Independent additions to the same block merge cleanly; changes to the same value still conflict. Free; setup is two git config commands plus the attribute lines.

  • A Jujutsu user who rebases stacks of small changes

    Clear the routine conflicts that appear when reordering commits

    Run jj resolve --tool mergiraf on a conflicted change. One user reports it settles about half of them; when it does not, undo and resolve by hand.

Before you commit

Setup
Download a binary from Codeberg, install from a distribution package or Homebrew, or run cargo install --locked mergiraf. Then set merge.conflictStyle to diff3, add the merge.mergiraf driver with two git config commands and add * merge=mergiraf to the global attributes file. Git 2.44 or newer is recommended. About ten minutes.
Integrations
Git as a merge driver (merge, rebase, cherry-pick, revert, stash apply), or mergiraf solve after a conflict; Jujutsu via jj resolve --tool mergiraf; mergiraf languages --gitattributes prints the extension list. New languages can be added declaratively from a tree-sitter grammar.
Data and privacy
Runs locally and sends nothing anywhere. GPL-3.0, which matters only if you ship modified copies of Mergiraf itself; merged files are your own.
Cost at scale
Free. Clean merges cost almost nothing because Git's line merge runs first; structured merging of a large conflicted file takes longer and can hit a timeout.
Limits
C and macro-heavy code often fall back to line merges; conflicts where order matters, such as two new statements in one block, are left to you; moved-and-edited code is only handled when all three revisions are available; 90 open issues on Codeberg.

What’s good

  • Acts only after Git's own merge has failed, and falls back on parse errors
  • 30 languages and 11 formats, including JSON, YAML, TOML and HCL
  • Turns duplicate keys from a clean line merge back into a conflict
  • Works with rebase, cherry-pick, revert and Jujutsu

What’s not

  • Weak on C, where macros defeat the parser
  • Can be slow on large conflicts and time out back to Git
  • A clean structural merge can still be logically wrong
  • Codeberg hosting: fewer eyes, no GitHub stars or issues

Best for

Developers and teams who rebase or merge often in Java, Rust, Python, TypeScript or config-heavy repos, and especially anyone maintaining a fork against a busy upstream.

Mergiraf: common questions

Is Mergiraf worth it?
Mergiraf removes a good share of the merge conflicts that were never real, cautiously enough to trust as a default, but it will not touch the hard ones and C code gains least. We rate it 4.1 out of 5.
How much does Mergiraf cost?
Free under GPL-3.0; binaries on Codeberg, crates.io and distribution packages.
What are the downsides of Mergiraf?
Weak on C, where macros defeat the parser; can be slow on large conflicts and time out back to Git; a clean structural merge can still be logically wrong; codeberg hosting: fewer eyes, no GitHub stars or issues.
Who is Mergiraf best for?
Developers and teams who rebase or merge often in Java, Rust, Python, TypeScript or config-heavy repos, and especially anyone maintaining a fork against a busy upstream.
How much does Mergiraf cost for a team or in production?
Free. Clean merges cost almost nothing because Git's line merge runs first; structured merging of a large conflicted file takes longer and can hit a timeout.
Is Mergiraf safe for company data?
Runs locally and sends nothing anywhere. GPL-3.0, which matters only if you ship modified copies of Mergiraf itself; merged files are your own.

Answers checked Nov 30, 2026.

Make Mergiraf? Show this rating on your siteMergiraf rated 4.1 out of 5 on ReviewRamble