Merges multiple branches that contain changes to mutually exclusive paths together.
npm install git-merge-distinctMerges multiple branches that contain non-conflicting changes to a particular set of paths together.
git-merge-distinct [
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
-i, --include
-x, --exclude
-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.
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'