Cloud
Cloud

Reputation: 19333

Can't push Git change - Change-ID not found

I'm promoting a change in my Git repository from master/trunk to a test branch, "beta". I was able to commit the changes just fine, but was unable to push the changes to Gerrit for code review. When I attempt to push to the branch via:

git push origin beta:refs/for/beta

It fails with the following error:

remote: Change-Id: 987899878087967896899087e908f7098890
remote: Hint: A potential Change-Id was found, but it was not in the footer of the commit message.

The change ID is fine, and is right there. It was included automatically when I cherry picked the change. How do I resolve this?

Upvotes: 3

Views: 2952

Answers (1)

Ill Tempered Sea Bass
Ill Tempered Sea Bass

Reputation: 309

Depending on the version of Git installed on your server, the "Change-ID" line has to be the very last line in your commit log.

Update your commit message using git commit --amend. Edit the commit log, and save it, and you're all set. Just move the line:

Change-Id: 987899878087967896899087e908f7098890

To the very last line of the commit log that is not commented out. Also, make sure there are no trailing empty new lines after this line. The commented-out lines of the commit log don't matter.

Upvotes: 3

Related Questions