Gerrit: combine multiple commits into one “change”

前端 未结 3 485
温柔的废话
温柔的废话 2021-01-30 13:30

As a git best practice, one should commit frequently, but to review the code you may need to review a patch consisting of multiple commits at once. Is there a way multiple comm

3条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-30 13:36

    If you need to update already posted review requests then you can leverage amend commits:

    git commit --amend -C HEAD
    

    and then push for consequent review.

    I believe that public commits should be atomic and contain the complete bunch of functionality which you want to contribute. Usually you do not want to share all of your intermediate commits. So squashing commits before review is good idea.

提交回复
热议问题