January 21, 2014

Updating Gerrit Change IDs

Sometimes when rebasing changes for gerrit you’ll make a mistake and Gerrit will reject the change ID, for example if it’s picking up an old change ID that it recognises, so you’ll need to change it. It’s actually relatively simple if you are using the commit-messge hook. Just use git commit -amend, delete all the old Change-Id lines and save. The hook will then generate a new Change-Id line.