Gerrit Push - Reference
Often times the initial patch submitted may have to be amended (e.g to fix build issues and/or address review comments). Follow these steps to amend the patch.
Do you already have a local copy of the code that needs to be amended?
Yes:
Does your local copy of the code match what is in the Gerrit patch to be amended?
Yes:
You do not need to do anything special to make additional edits to the code.
No:
Backup any modified files you would like to retain, as the next step will delete any such modifications.
Reset your local copy to what is in the patch:
git reset --hard origin/master
No:
Start with a new clone of the code:
For example -
git clone
https://gerrit.onap.org/r/dcaegen2/services
Checkout the patch you want to edit/amend
You can get this exact URL by clicking the 3 vertical dot buttons on upper right corner of the browser window showing the gerrit push, click “Download Patch”, then copy the "Checkout" string.
For example -
git fetch
https://gerrit.onap.org/r/dcaegen2/services refs/changes/73/130673/1&& git checkout FETCH_HEAD
Make the required edits
Add the updated files and Commit with the
--amend
option (instead of starting a new commit):git add
<files edited>git commit -as --amend
Push the patch for review
git review