gerrit

Gerrit submission has conflict


Why there is a conflict when I submit a change into a branch on Gerrit, but when I rebase my change onto that branch locally, git can do a fast forward rebase and without any conflict?

The behavior of Gerrit submission is not like git's merge. Why?


Solution

  • Gerrit is very conservative with merges/rebasing. If a file has been modified by your commit has also been modified in the branch you are trying to merge with, Gerrit will fail with a conflict even if git is capable of resolving the conflict automatically. This is just to be extra safe.

    In newer versions of Gerrit there is a configuration to turn this safety check off, and have Gerrit trust git's automerge results.