Page History
...
A critical thing to point out is that you need submit a new version of the entire change - not just an update to the change.One way of modifying an existing change is to apply the updates to your tree as usual and create a new commit (this time the commit message doesn't matter as you are about to change it). Then, merge the two changes using git rebase -i <parent-branch>. Interactive rebase will display a list of patches in an editor
, and you can "squash" the the modifications to the patch in the new commit into the original patch. (See the help text in the commit message editor window for more information.) Then it will put you in an editor again to manually merge the two commit messages. Make sure you keep the original Change-Id: line, and delete the new one, and edit the commit messages so they're combined into a single commit. If you The easiest way to update the most recent commit (which is often the one you want to update), is to use "git commit --amend -a". This will "add" any modifications in the current repository and merge them into the last commit. If there are no changes, or "-a" is not used, it will only editing the most recent commit comment. This is useful if you don't have a Change-Id: line in your commit message (because you didn't install the commit-msg hook, see Commit Comments) you can copy it from the top above), but one was added automatically by Gerrit. You can copy the Change-Id: line from the Gerrit web page for that change and paste it into the amended commit message.
Another way of modifying a series of existing changes is to use "git rebase -i <parent-branch>". Interactive rebase will display a list of patches in an editor, and you can reorder the patches, "edit" the patch, "reword" the commit comments, and "squash" two patches into a single patch. See the help text in the commit message editor window for more information.
Once the change has been updated it into the new commit message. Once the change is committed, push your branch to Gerrit again, and the original request will be updated with the new version of the patch.The easiest way to update the most recent commit comment
(
...
(Re-)Basing One Change on Another Change
...
If both patches are being developed by the same person, the easiest way to have a series of dependent changes is to commit them into separate patches order on the same branch. Then, when a change is made to any patch on that branch, all of the dependent changes will also be resubmitted to Gerrit so that they will be ready to land when the earlier patches are merged.
If updates or fixes need to be made to one of the patches, it these updates should be merged into the original commit where the code was added, rather than being an additional patch at the end of the series. This can be done by running "git rebase -i <parent-branch>", then marking a particular patch for edit. That will cause the earlier patches in the series up to the to be applied, then stop for interactive editing/testing of that patch. Once the patch has been updated, run git add {modified files} to include the new updates into this patch, and git rebase --continue to merge the updates into the existing patch and continue the rebase process.
...
Note, this requires certain privileges on the server. If review is a secondary server for your repository, use:
| No Format |
|---|
git push review TAG_NAME |
...