How to amend review issues in Gerrit when there is a second newer review also

前端 未结 6 1846
梦毁少年i
梦毁少年i 2021-02-02 14:05

Still trying to learn how to use Gerrit and its process. Steps I did where

  1. Push first change1 to gerrit for review to HEAD:refs/for/develop
  2. W
6条回答
  •  无人及你
    2021-02-02 14:38

    The situation is exactly like @Trevor explained. rebase -i is a good way to do when you have this condition.

    Personally, I use this command as well but with a little bit different:

    1. Use --fixup and --autosquash

    you have two commits:

    old commit
    new commit
    

    when you want to change old commit, then

     git commit --fixup 
    

    then rebase with autosquash,

    git rebase -i --autosquash 
    

    If it's unclear of my comments, you can check the detail in: https://fle.github.io/git-tip-keep-your-branch-clean-with-fixup-and-autosquash.html

    OR

    2. Take advantage of Gerrit

    After you commit two changes, you will have two open-reviews change on you GUI.

    Then go to your "old change", select download -> checkout this change, actually after you checkout, you will go to a branch for this change, then fix your code, amend, rebase, push ... like what you do as usual.

提交回复
热议问题