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

后端 未结 3 1175
北恋
北恋 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 07:05

    @Uncletall put all the steps there and the link, the only thing is that you should not delete the changeId and you should do a git commit --amend. I am giving him a +1.

    It should be like this

    1. On Gerrit, go to the review, select "checkout", on the Download field as opposed to "pull", "cherry-pick", or "patch", then copy the command.

    2. On the git project paste the copied link from above

      This will create a detached head, which is a branch with no name (I've been through the desert on a horse with no name, It felt good to be out of the rain.)

    3. Name that horse! git checkout -b new_branch_name

    4. Change what you want and do a git add on the files you want.

    5. Do git commit --amend and keep the same Change-Id.

    6. Push your changes:

      git push origin :refs/for/

提交回复
热议问题