Project

kintsugi

0.23
The project is in a healthy, maintained state
Kintsugi resolves conflicts in .pbxproj files, with the aim to resolve 99.9% of the conflicts automatically.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
 Dependencies

Development

~> 13.0
~> 3.9
= 1.12.0
~> 0.21

Runtime

= 1.19.0
 Project Readme

Kintsugi Logo

Kintsugi Ruby Style Guide

What is this?

One of the frustrations of working with Xcode together with Git is resolving conflicts in Xcode project files, i.e. the project.pbxproj file.

Kintsugi sets out to solve this exact problem: Automatically resolving Git merge conflicts occurring in .pbxproj files.

The end goal is for the tool to succeed 99.9% of the time, and let you resolve the real conflicts in a convenient way the rest of the time.

Kintsugi (金継ぎ) is the art of repairing broken pottery by mending it with gold. Wikipedia

How?

Kintsugi understands the changes you've made to the .pbxproj file, so it simply resets the conflicts and re-applies those changes to it.

From a technical perspective, Kintsugi heavily relies on Xcodeproj. It uses its diff capability to extract the changes, and uses its project files editing capabilities to apply the changes.

Installing Kintsugi

$ gem install kintsugi

If you prefer to use bundler, add the following line to your Gemfile:

gem 'kintsugi', require: false

Usage

When there's a .pbxproj file with Git conflicts, and a 3-way merge is possible, run kintsugi <path_to_pbxproj_file>.

And see the magic happen! ✨

Git merge driver

To use Kintsugi as a Git merge driver, follow these steps:

  • Add it as driver to Git config file by running the following:
git config merge.kintsugi.name "Kintsugi driver" # Or any other name you prefer
git config merge.kintsugi.driver "kintsugi driver %O %A %B %P"

kintsugi should be in your PATH. Run git config with --global to add this to the global config file.

  • Add the following line to the .gitattributes file at the root of the repository:

*.pbxproj merge=kintsugi

This will instruct Git to use Kintsugi as a merge driver for .pbxproj files.

See the official docs if you want to set this globally.

Contribution

See our Contribution guidelines.

Alternatives

  • XcodeGen: You can commit this JSON file into Git instead of the .pbxproj file. Then resolving conflicts is much easier.

Copyright

Copyright (c) 2021 Lightricks. See LICENSE for details.