Code Monkey home page Code Monkey logo

automerge-git-merge-driver's Introduction

maintainer
pvh

git-merge-driver-automerge

This is a simple example of a git custom merge driver for automerge. It is derived from https://github.com/Praqma/git-merge-driver but any problems are my own fault.

Included in this repository is a not-very-promising approach to merging text files paired with more canonical .mrg files.

Demo

Run example.sh for a demonstration of the merge driver. It will create a merge conflict in the repository, causing the merge driver to start and resolve the conflict.

Documentation

git config

First up is defining the merge driversd. This is done via local git config. See mergetool-setup.sh for an example. Unfortunately, each user must run these commands in their own directory.

For more, visit git-scm.com - Git Attributes.

Distribution

Note that, much like git hooks, the .git/config file can't be checked in/shared through the repository. A common way of distributing merge drivers is to check the configuration file in elsewhere and provide a script to copy it to .git/config. In this repository, the merge driver is configured in the .gitconfig file, which is copied to .git/config by the mergetool-setup.sh script.

merge driver

For a successful merge, the merge driver is expected to leave the merge result at %A's path and exiting with status code 0.

If the merge went awry, the merge driver can exit with a non-zero status code.

Note: Any tools or scripts called by the merge driver must be available on PATH.

git attributes

You configure the file patterns you want the merge driver to be used for in the .gitattributes file:

*.mrg merge=my-custom-driver

Resources

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.