Gerrit accidentally introduced some merge commits (configured with "Merge if necessary" option) and I would like to remove them from the history. I am aware of the pitfalls of rewriting history when team working with Git, but developers will not suffer from this in our case, as none of them have local changes in this particular repository.
I did a git rebase -i
locally and Git automatically removed Gerrit's merge commits.
I carefully removed the previous Gerrit Change-Ids in each commit messages and the Gerrit commit message hook added new ones.
git status
command output:
On branch master Your branch and 'origin/master' have diverged, and have 7 and 9 different commits each, respectively. (use "git pull" to merge the remote branch into yours) nothing to commit, working directory clean
Which is what I want (9 commits minus the 2 merge commits).
When I try to push on Gerrit with git push origin HEAD:refs/for/master
I get no error.
However when I try to review and submit on Gerrit web interface, I get the following error:
The change could not be merged due to a path conflict. Please rebase the change locally and upload the rebased commit for review.
What have I done wrong?