Cannot merge in Gerrit

前端 未结 3 1469
日久生厌
日久生厌 2021-01-30 11:48

Whenever I sent a review to Gerrit and if the review is pending for some time, I am getting cannot merge message in Gerrit.

I understood its coming because

3条回答
  •  盖世英雄少女心
    2021-01-30 12:19

    The best practice when working on a shared code base using git/gerrit is to keep individual changes as small as possible. Instead of submitting your change in a single larger commit, split it into a series of smaller commits (submit the branch to gerrit) that have one logical change per commit. This workflow:

    • reduces the chance of conflict in a single change
    • makes conflicts easier and quicker to resolve
    • make the change quicker to review

    This way, the chance that someone merges his changes before you lowers. You should rebase as soon as possible so that the changes can be reviewed more easily. Rebasing regularly against the upstream branch means you keep up-to-date with changes, and don't have to deal with a large merge conflict (you get smaller, more manageable issues to resolve).

    I'm not sure this answers your question but I follow these two rules and have no problems.

提交回复
热议问题