Skip to content

A helper utility that allows block particular commits during GIT merge

License

Notifications You must be signed in to change notification settings

niamster/gitmerge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

A helper utility that allows block particular commits during GIT merge

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages