1.0.0 • Published 1 year ago

git-json-merge v1.0.0

Weekly downloads
563
License
MIT
Repository
github
Last release
1 year ago

git-json-merge

A git merge driver that use xdiff to automatically resolve merge conflicts in json files. It also detects indentation automatically. This project was inspired by git-po-merge.

@git-json-merge NPM Version

Install

This can be done one of two ways, globally or per-project/directory:

Globally

Install:

npm install --global git-json-merge

Add to ~/.gitconfig:

[core]
    attributesfile = ~/.gitattributes
[merge "json"]
    name = custom merge driver for json files
    driver = git-json-merge %A %O %B

Create ~/.gitattributes:

*.json merge=json

Single project / directory

Install:

npm install git-json-merge --save-dev

Update git config:

git config merge.json.driver "$(npm bin)/git-json-merge %A %O %B"
git config merge.json.name "custom merge driver for json files"

Add the same .gitattributes where desired and commit. Note .gitattributes is only used after committed.

Helpful docs:

Thanks:

1.0.0

1 year ago

0.4.5

4 years ago

0.4.4

7 years ago

0.4.3

7 years ago

0.4.2

7 years ago

0.4.1

7 years ago

0.4.0

8 years ago

0.3.5

8 years ago

0.3.4

8 years ago

0.3.3

8 years ago

0.3.2

8 years ago

0.3.1

8 years ago

0.3.0

8 years ago

0.1.0

8 years ago