Often times you will need to update the commit after it is already pushed. For example you may need to change something based on a comment in Gerrit.
It is important that you update the commit and do not submit a brand new change. This will keep the comment and patch history in place.
Save your current xCode work by commiting it Note: you do not need to push to origin
Go to the change in Gerrit Expand the patch set you want to edit In the download section click checkout and ssh Copy the command given, it should be something like:
git fetch ssh://user@server/projectname refs/changes/00/700/1 && git checkout FETCH_HEAD
Navigate to the project folder Run the command gathered in last step
git fetch ssh://user@server/projectname refs/changes/00/700/1 && git checkout FETCH_HEAD
Do what you do.
Navigate to project folder in terminal Add files to commit with git add .
git commit — amend — no-edit
git push origin HEAD:refs/for/master
Now your Gerrit change will have a new patch set and all history will be preserved
Author
Originally published at www.parsed.io.