Are you held back by conflicts? Then meet

Mergiraf

Mergiraf can solve a wide range of Git merge conflicts. That's because it's aware of the trees in your files! Thanks to its understanding of your language, it can often reconcile the needs of both sides.

You can teach Mergiraf a new language in a completely declarative way. It's a nonviolent animal, so it prefers that over imperatives.

Demo

Configure Git to use Mergiraf instead of its default merge heuristics. This will enhance git merge, revert, rebase, cherry-pick and more.

You can also keep Git's original behaviour and manually invoke Mergiraf after encountering conflicts.

A giraffe observes a fighting pair

Figure 1: Two git users making inadequate use of blame, push and pull to resolve a conflict

Ready to give it a try?

Head to the installation page and start merging nonviolently today!

Aspirations

Mergiraf is designed with your needs in mind. Its goals are:

Don't sweep conflicts under the rug

Syntax-aware merging heuristics can sometimes be a bit too optimistic in considering a conflict resolved. Mergiraf does its best to err on the side of caution and retain conflict markers in the file when encountering suspicious cases.

If it manages to resolve all conflicts on its own, it encourages you to review its mediation work via the mergiraf review command. If a merge looks faulty, you can report it easily.

Be fast enough for interactive use

The giraffe surrounds the pair with its neck and they are surprised by its intervention

Figure 2: Mergiraf offers to mediate

Did you know that giraffes can run as fast as 60 kilometers per hour? Anyways. The operation of merging diverging versions of files happens routinely when working on a code base, often without you noticing as long as there aren't any conflicts. So Mergiraf tries to be quick so as not to interrupt you in your tasks.

Be open to other methods

In many cases, line-based merging works just great and there is no need for tree-munging business. If a line-based merge is conflict-free, then Mergiraf just returns that merge (which is very quick). One exception to this rule is when line-based merging creates duplicate keys. In such a case, Mergiraf does a bit more work to resolve the issue or highlight it to you with conflict markers.

The giraffe winks with the pair successfully reconciled, as they are now siamese siblings
Figure 3: Harmony and peace reign on Earth

Illustrations by Freya F-T, CC-BY 4.0.