user1951756
user1951756

Reputation: 511

Delete Patch Set in Gerrit

Is there a way to delete a patch set in Gerrit? I accidentally pushed a file with a password in it to my change. I removed the file in another patch set but the file is still visible in the patch set history. I attempted to find a way to delete that particular patch set but the only thing I could find on how to do this was the following documentation...

https://gerrit-documentation.storage.googleapis.com/Documentation/2.8/cmd-review.html

which shows a delete option but that option is no longer available in later versions.

I ended up just checking out the latest patch set, creating a new branch, deleting the current change in gerrit and pushing the change from the new branch which removes the old patch sets but it seems a bit cumbersome.

Upvotes: 0

Views: 6199

Answers (1)

No, you can't delete a patch set in Gerrit, but it's possible to delete the whole change. If you do not see the "Delete change" option, it's because you don't have permission to do that.

There are two permissions to control this, see the Gerrit documentation:

Last but not least, in these cases, it's better to simply change the password instead of trying to remove it from the repository. It's better safe than sorry.

Upvotes: 1

Related Questions