How to re-push as drafts to gerrit?

1.3k Views Asked by At

I by mistake pushed my changes into the gerrit using git push origin HEAD:refs/for/xxxx

Instead of git push origin HEAD:refs/drafts/xxxx

I want to move those changes to the drafts.

I know that we need to abandon these and then re-push the changes to the gerrit as drafts.

But I want to know is there any command or any other way where I can push these changes to drafts?

2

There are 2 best solutions below

0
On

There is plugin that might be useful WIP. It doesn't change it to draft, but changes set to WIP (Work In Progress) won't show on Review Requests for the other developers.

2
On

There is a plugin named force-draft which provides a ssh command that changes the status of a patchset to draft.

See more info here.

Download the plugin here.