Gerrit 和仓库
我在 gerrit 上上传了一个补丁 X,但错误地包含了一个不应该包含在补丁中的文件 Y。现在,我想提交 X 的新补丁集,但不包含文件 Y。是否可以执行此操作
从 X 的新补丁集中删除 Y 的步骤
手动删除我在 Y 中所做的所有更改(不是最好的方法,但它从 X 的新补丁集中删除了 Y)git add 。
git commit -s --amned
仓库上传。
I uploaded a patch X on gerrit, but by mistake I included a file Y that I shouldn't have included in the patch. Now, I want to submit a new patchset for X, without the file Y. Is it possible to do that
Steps to remove Y from new Patchset for X
Manually removed all the changes I made in Y (Not the best way to do that, but it removed Y from new Patchset for X)git add .
git commit -s --amned
repo upload .
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
简短的回答:
这将使
仍然在本地修改,因此假设您根本不再需要修改,您现在可以恢复该修改:这是最快的方法它。另一种选择:
The short answer:
this will leave the
<file>
locally modified still, so assuming you didn't want the modification at all anymore, you can now revert that modification:That is the quickest way to do it. Another option:
我没有太多使用 Gerrit,但我相信你可以修改提交。
http://gerrit.googlecode.com/svn/documentation/2.0 /user-changeid.html#amend
评论后:
您是否确保 Change-Id 行存在并且是提交消息的最后一行?如果提交消息中不存在 Change-Id 行,请从 Web 上的更改页面复制该行并将其放入提交消息中。
I haven't used Gerrit much, but you can amend the commit I believe.
http://gerrit.googlecode.com/svn/documentation/2.0/user-changeid.html#amend
After comment:
Are you ensuring that the Change-Id line is present and is the last line of your commit message? If Change-Id lines are not present in the commit messages, copy the line from the change's page on the web and put it in your commit message.
您的更改已被审核吗?如果它们仍在等待审核,您可以将其标记为已放弃并删除它们。之后您可以再次提交正确的代码。
如果您的更改已审核并且补丁已合并到 git 存储库中,那么解决方案应该与撤消线程中解释的 git Push 没有什么不同;
撤消“git推送”
is your change already reviewed ? If they are still waiting for review, you can just mark it as abandoned and get rid of them. Afterward you can commit the right code again.
if your changes reviewed and patch already merged into the git repository, the solution should not be different undoing a git push which is explained in the thread;
Undoing a 'git push'