Search This Blog

Wednesday, June 13, 2012

HowTo: Fix Gerrit 'Failure to submit due to path conflict'

Failure to submit due to path conflict but no real conflict. - Google Groups
Git Tools - Stashing


While there's a lot of discussion, there's no real howto to fix things up using repo using three simple commands.

Gerrit won't merge when someone is too slow to merge your changes, you've ameded your merge...A change came in before your change was merged...it happens...a lot.


repo start [branchname]
# You've made your changes and sent them to Gerrit...
repo upload

Gerrit merge fails. Here's HowTo fix it.

# Get on your repo start [branchname]
git checkout [branchname]
# Find the name of the remotebranch you are merging to with Gerrit.
git remote
[remotebranch]
# Your local changes need to be stashed for now.
git stash

# Fix your branch so you can merge with Gerrit.
git rebase [remotebranch]/master
# Reapply any local changes
git stash apply
# Amend the commit on your fixed branch.
git add .
git commit --amend
# After upload, you should see a new patch to your merge in Gerrit.
repo upload
# Get rid of stashed changes that have been merged
git stash clear

At this point, you should be able to review and merge in Gerrit, hurry up :)