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.


  1. Do you already have a local copy of the code that needs to be amended?
    1. Yes:
      1. Does your local copy of the code match what is in the Gerrit patch to be amended?
        1. Yes:
          1. You do not need to do anything special to make additional edits to the code.
        2.  No:
          1. Backup any modified files you would like to retain, as the next step will delete any such modifications.
          2. Reset your local copy to what is in the patch:
            • git reset --hard origin/master
    2. No:
      1. Start with a new clone of the code:
  2. Checkout the patch you want to edit/amend
    1. 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.
  3. Make the required edits
  4. Add the updated files and Commit with the --amend option (instead of starting a new commit):
    1. git add <files edited>
    2. git commit -as --amend 
  5. Push the patch for review
    1. git review
  • No labels