Not exactly in one go, but it is possible with git rebase
:
- start the rebase with
git rebase --interactive <LAST_PUSHED_VERSION>
- In the editor coming up, change
pick
tor
orreword
- save the file and exit the editor
- now, every commit message you selected to
reword
will come up in your editor. Correct the message, save the file and close the editor
Once rebasing is finished, you corrected all your commit messages you wanted to.
However, since this is a bit of effort, best solution would be to tell Gerrit to accept commits without Change-IDs as supposed by HiB in his comment.
See also Gerrit error when Change-Id in commit messages are missing for a discussion on this topic.