1

Setup:

  • the base product - living on the master branch
  • a fork of the base product with customisation for a client - living on a separate feature branch

For now all the commits in master should be merged to the feature branch. The feature branch has commits that customise the base product/add new functionality.

Is there a way to avoid the empty merge commit when merging master to the feature branch? The merge commits are polluting the history as we are merging to the feature branch several times a day to get the new changes from master to the feature branch.

Note: rebase won't work as the feature branch contains a lot of commits outside of master and it would cause conflicts that need to be resolved each time.

1 Answer 1

1

Few solutions come to mind:

  1. Don't be so hyped about having a "nice" git history. Merges are part of the history. You don't want to see them ? git log --no-merges. Woop, clean history, with all the real merges benefits.

or

  1. Use rebase and git rerere so don't resolve the same conflicts twice. I don't advocate for this solution since rebase lose information about the original context of the commit, as every history-rewriting feature do. More informations about rerere here.
Sign up to request clarification or add additional context in comments.

1 Comment

marking as correct as it confirmed that there's no reasonable way to achieve this and is fine to have it in the history. git log --no-merges can't be specified while viewing logs in the IDE (I'm using Intellij). rerere is not an option as the 'history' should be preserved

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.