How to change a patchset and push it as a new one?

后端 未结 3 1211
北恋
北恋 2021-02-04 06:00

Is it possible to fetch an existing patchset (that has not been merged into my local machine), change and push it as a new Patch Set?

3条回答
  •  面向向阳花
    2021-02-04 06:53

    Consult Trying out a Change in the official documentation.

    Here is what you do:

    1. Checkout the change as described in the documentation
    2. Create a local branch from the FETCH_HEAD
    3. Modify your code
    4. Commit the change using git --amend and remove the Change-Id in the commit message
    5. A new Change-Id will automatically be added and this will result in a new Change Set
    6. Push your change for review and Gerrit will see it as a new Change Set

    As pointed out by @magnus-bäck, I was describing how to create a new Change-Set. If you want to add a new Patch Set to the current review you should NOT remove the Change-Id.

提交回复
热议问题