Skip to content

jonatanpedersen/git-json-merge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

68 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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:

About

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

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published