git commit --amend works, but, as mentioned here:
you need to add the gerrit
change-id
at the bottom of your commit message (Change-Id: 234j243rasdf...
) right before the git #'ed commit description and the change will be patched onto your previous commit –
See more about Change-Id in the Gerrit documentation.
Change Upload
During upload by pushing to a
refs/for/*
orrefs/heads/*
branch, Gerrit will use the Change-Id line to:
- Create a new change:
If this is the first time it has seen the Change-Id mentioned in the commit message, Gerrit will create a new change for review.- Update an existing change:
If Gerrit has seen this Change-Id before, but has not yet seen this new commit object, Gerrit will add the new commit as a new patch set on the existing change.- Close an existing change:
If Gerrit has seen this Change-Id before, and the commit is being pushed directly into a branch, the existing change is updated with the new commit, and the change is closed and marked as merged.