Code Monkey home page Code Monkey logo

merge-drivers-cli's Introduction

CLI's logo

Merge Drivers CLI

A command-line interface to conveniently manage custom git merge drivers.

Current npm package version. Monthly downloads Current CircleCI build status. PRs welcome! Merge Drivers CLI is released under the MIT license.


Git offers the ability to define two types of custom merge drivers. The first one is global, accessible through ~/.gitconfig. The second one is local, accessible through .git/config. The problem is that the configuration of these drivers is not very convenient as neither of these solutions are versioned.

This CLI aims to solve this problem by providing a simple and intuitive interface to manage these drivers.

๐Ÿ“š Use Custom Merge Driver to Simplify Git Conflicts.

Usage

Merge drivers are defined within a configuration file that should be living at the root of your project named as .merge-drivers.yml. This file is a YAML file that should contain a list of drivers (under merge-drivers key). Each driver is defined by a key, name, and a driver (command). Here is an example of such a file:

merge-drivers:
  yarn:
    name: 'yarn merge driver'
    driver: 'yarn install'

From there, you will be able to use the following commands:

Ideally, we would like to automate the installation of those merge drivers.

Warning

It could be achieved by using a prepare script in your package.json file. However, it may not possible depending on your package manager (e.g., Yarn 2 and above don't execute prepare, so you would want to look into postinstall, see Husky documentation for Yarn 2+ as a good reference).

Install

Installs merge drivers based on the provided config.

Note

Automatically executes clean command before installing, unless --no-clean is specified.

npx merge-drivers install [merge-drivers...] [--no-clean]

Uninstall

Uninstalls merge drivers based on the provided config.

npx merge-drivers uninstall [merge-drivers...] [--no-clean]

Clean

Cleans merge drivers by uninstalling the ones that are disabled based on the provided config.

Note

Automatically executed as part of install command, unless --no-clean is specified.

npx merge-drivers clean

License

merge-drivers is MIT licensed.

merge-drivers-cli's People

Contributors

charpeni avatar

Stargazers

 avatar

Watchers

 avatar

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.