如何更改补丁集并将其推向新的补丁集? [英] How to change a patchset and push it as a new one?

查看:62
本文介绍了如何更改补丁集并将其推向新的补丁集?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以获取一个现有的补丁集(尚未合并到我的本地计算机中),进行更改并将其作为新的补丁集推送?

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?

推荐答案

@Uncletall将所有步骤和链接放在那里,唯一的事情是您不应该删除changeId,而应该执行git commit --amend.我给他+1.

@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.

应该是这样

  1. 在Gerrit上,转到下载"字段,而不是"pull","cherry-pick"或"patch",选择"checkout",然后复制命令.

  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.

在git项目上,从上方粘贴复制的链接

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.)

给那匹马起个名字! git checkout -b new_branch_name

Name that horse! git checkout -b new_branch_name

更改所需的内容,并对所需的文件执行git add.

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

执行git commit --amend保持相同的Change-Id.

推送更改:

git push origin <new_branch_name>:refs/for/<thatgerritbranchyouwanttochange>

这篇关于如何更改补丁集并将其推向新的补丁集?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆