混帐:樱桃采摘新格里特补丁 [英] git: cherry-picking a newer gerrit patch

查看:168
本文介绍了混帐:樱桃采摘新格里特补丁的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我与Android开发工作,所以从其他gerrits我的樱桃采摘一些提交。

I'm working with android development, so I'm cherry-picking some commits from other gerrits.

编辑:在这里,在这幅画你可以看到我说的:

Here in this picture you can see what I'm talking about:

http://i.imgur.com/1oHgqVM.png (对不起,我可以' T发表的图像在这里)

http://i.imgur.com/1oHgqVM.png (Sorry I can't post images here)

我有樱桃挑到我的消息来源补丁1,我上传到我的github。

I have cherry pick into my sources patch 1 and I uploaded to my github.

现在我看到他们上传的补丁3,因此:

Now I see they have uploaded patch 3, so:

我应该做我摘樱桃(补丁1)的混帐复归,做了最新补丁的樱桃挑,然后将其上传到我的github?

Should I do git revert of my cherry-pick (patch 1), do a cherry pick of the newest patch and then upload it to my github?

还是有办法告诉github上,我想用一个新的补丁提交我没有覆盖(从补丁1 upgrate修补3)?

Or is there a way to tell github that I want to overwrite with a new patch the commit I did (upgrate from patch 1 to patch 3)?

推荐答案

您想摆脱的补丁1 ,并用补丁替换3

您首先需要获取在补丁3 git的审核提交-d更改其中的更改是格里特审核数量。

You first need to fetch the patch 3 commit with git review -d change where change is the gerrit review number.

让说的补丁1 有SHA a302c44和补丁3 有SHA 85050faa和你有你的工作分支(您上传到GitHub的一)五,提交。您现在可以运行 git的变基-i HEAD〜5 ,它就会打开一个编辑器的东西,如:

Let say patch 1 has SHA a302c44 and patch 3 has SHA 85050faa and you have five commits in your working branch (the one you uploaded to your github). You can now run git rebase -i HEAD~5 and it will open an editor with something like:

pick 1b7585b stop.sh: only try killing processes that belong to me
pick a302c44 THIS IS PATCH 1
pick 1eb0cd5 osd: only verfy OSDMap crc if it is known
pick 3f6be22 doc: Updates man page for ceph-disk.
pick 2862a49 doc: Adds updated man page for ceph-disk under man/

和手动替换 a302c44 85050faa (可以忽略评论,也不会予以考虑)。一旦保存并关闭编辑器,Git重订将摆脱补丁1提交的(因为它没有任何地方显示),并使用补丁3提交代替。

and you manually replace a302c44 with 85050faa (you can ignore the comment, it won't be taken into account). Once you save and close the editor, git rebase will get rid of the patch 1 commit (because it does not show anywhere) and use the patch 3 commit instead.

这篇关于混帐:樱桃采摘新格里特补丁的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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