How to do backup of development branches with Gerrit?

[亡魂溺海] 提交于 2019-12-07 23:54:49

问题


I'm using Gerrit to manage my git repository. Patches are sent to Gerrit server and merged into the git repository when they are approved. However, often a feature takes some time to develop and the developer wants to keep a backup of the code under development. The obvious solution is to push the branch directly to Gerrit, but then https://code.google.com/p/gerrit/issues/detail?id=1986 prevents me from submitting this branch to review.

A possible hack is to remove the remote branch when I want to submit it to review. A second one is to rebase the remote branch and update change IDs when I want to submit it to review.

How do you handle this problem?


回答1:


Have you tried the draft reference? It is useful when a code should backup, without listing it as an open patchset. Then if the code is ready it can be published. My suggestion is to avoid reviewing more then one commit. More commits/changes harder to be efficient on a review.




回答2:


The simplest way to fix this is to amend the commit. This will create a new commit that can then be pushed to another branch.

git commit --amend
git push origin HEAD:refs/for/master


来源:https://stackoverflow.com/questions/29703552/how-to-do-backup-of-development-branches-with-gerrit

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!