I am rebasing a branch of several commits onto an upstream branch. I am blocked by a failure of some kind where I can't continue to the remaining commits in my branch, so I need a way to continue when git reset does not seem to work.
As I said I'm rebasing a branch. I do rebasing like this all the time, and I am not surprised that one or two commits have conflicts that resolve down to empty commits. But I don't know which commits until I go through the conflict resolution steps (editing the files that conflict and adding the resulting files). So here's an abstracted version of what happened:
$ git checkout working_branch
$ git rebase -i upstream
[Here it is reported that file.c has conflicts. I edit it.
The resulting diff is empty.]
$ git add file.c
$ git rebase --continue
The previous cherry-pick is now empty, possibly due to conflict resolution.
If you wish to commit it anyway, use:
git commit --allow-empty
Otherwise, please use 'git reset'
rebase in progress; onto xxxsha
However at this point git reset
is of no help, I end up with the same exact status. I don't wish to have an empty commit. I have come upon potential empty commits from this process before and I have always been very happy to have the commit disappear.
I came upon the question git cherry-pick not working in which almost the same exact results occur, but from cherry-picking one commit, not rebasing a branch. The other inquirer was happy to just go ahead and not do the cherry-pick. Stepwise I guess rebase uses cherry-pick for each commit, I have several commits to step through. In my case this happened on the first commit of my branch and I need a real solution to continue.