Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including git-merge-distinct with all npm packages installed. Try it out:

git-merge-distinct lists no main file and has no index.js, so it can't be directly required. If this is a mistake, please let us know. It may however contain internal files that you can require manually:

// require("git-merge-distinct/[??]")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

git-merge-distinct v0.0.9

Merges multiple branches that contain changes to mutually exclusive paths together.

git-merge-distinct

Merges multiple branches that contain non-conflicting changes to a particular set of paths together.

Usage

git-merge-distinct [<options>] [<branch glob>]

branch glob is an optional glob that specifies which branches to consider.

Options:

  -n, --no-commit              perform the merge but do not autocommit, to give the user a chance to inspect and further tweak the merge result before committing
  -m, --message <message>      override the default commit message
  -i, --include <path glob>    only branches with changes modifying paths matching this pattern will be included
  -x, --exclude <path glob>    any branches with changes modifying paths matching this pattern will be excluded
  -h, --help                   output usage information
  -V, --version                output the version number
  -d, --debug                  output debug information

Note that the command creates a new commit without updating the current ref, as the resultant commit is usually used for staging a deployment and then thrown away. If you want to create or update a ref to point to the created ref, you should use git branch or git update-ref accordingly.

Installation

  • Install Git, Node.js (tested against v0.10.35) and npm
  • Run npm install -g git-merge-distinct. You may need sudo.

Examples

Create a new commit by merging the branches starting with "blog/" with changes modifying only paths under "app/posts" into the current HEAD.

$ git merge-distinct -i 'app/posts/**' 'blog/**'

Merge all branches with changes modifying distinct paths into the current HEAD.

$ git merge-distinct

Merge all branches with changes modifying paths under /static, ignoring those that modify js or coffee files.

$ git merge-distinct -i 'static/**' -x '**/*.js' -x '**/*.coffee'
RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free