Skip to content

Latest commit

 

History

History
53 lines (38 loc) · 2.49 KB

README.md

File metadata and controls

53 lines (38 loc) · 2.49 KB

gitmerge

Coverage Status Build Status Code Climate

About

gitmerge is a helper utility that allows to block particular commits during the merge of GIT branches.

Why one might need that? This is mainly useful when merging maintenance branches into the mainstream(master) branch.

Depending on the workflow it's possible to have maintenance or customer-specific branches along with the master branch. These branches are also called LTS branches.

Oftentimes the hot fixes go into the branches where the bug was reported and then the commit is merged back into the master branch.

General practice is to have all branches perfectly synchronized with the master, i.e. you want to see a clear delta between a particular branch and master to understand whether the master contains all features and bugfixes.

However sometimes you don't want particular commits because they are customer-specific and shall not be visible by other users. Or your master branch diverged that much that it requires completely different approach to fix the issue, or even better, the problem is not anymore present there.

Also in case of cherry-pick from master into the maintenance branch the resulting commit shall be blocked in master.

Installation

gem install gitmerge

Usage

Assuming that current working directory is a working diroctory of GIT repository:

# block commits <commit-0> and <commit-1> in HEAD from <branch-0>
gitmerge block <commit-0> <commit-1>
# merge rest of <branch-0>
gitmerge merge <branch-0>

Gitmerge also supports blocking and merging without switching the branches(assuming no conflicts are possible):

# block commits <commit-0> and <commit-1> in <branch-1> from <branch-0>
gitmerge block -r /path/to/git-wd -b <branch-1> <commit-0> <commit-1>
# merge rest of <branch-0> into <branch-1>
gitmerge merge -r /path/to/git-wd -b <branch-1> <branch-0>

Consult the help for the full list of options.

Conflicts

Gitmerge does not try to resolve merge conflicts but relies on the user(as during normal GIT merge).

Once the conflict is resolved it's probably required to rerun gitmerge to complete initial merge.

License

MIT. See LICENSE file.