0

I have a local brand new branch and I want to cherry pick some commits. A few picks ran OK but the next one produced a conflict:

>git cherry-pick 676b371
error: could not apply 676b371... fixed connection resolution.
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'

So I tried to look what's wrong and got this:

>git status
On branch MyBranch
fatal: Could not open file .git/rebase-merge/done for reading: No such file or directory

What does it mean? My repo is broken? How do I fix that?

Update: ran as suggested:

>git cherry-pick --abort

>git status
On branch MyBranch
fatal: Could not open file .git/rebase-merge/done for reading: No such file or directory

Update2: this is a content of .git/rebase-merge folder:

git-rebase-todo
git-rebase-todo.backup
head-name
interactive
onto
orig-head
quiet

p.s.

git version 2.10.1.windows.1

UserControl
  • 14,766
  • 20
  • 100
  • 187
  • What if you use `git cherry-pick --abort` to stop pick the commit `676b371`, and then use `git status` to check what's your git repo's state? If your working directory is clean, then cherry-pick the commit by `git cherry-pick 676b371`. – Marina Liu Jul 13 '17 at 09:24
  • @Marina-MSFT, thanks, updated my question. – UserControl Jul 13 '17 at 09:35
  • Please check in your `.git` folder and find if you have the file `.git/rebase-merge/done`. If has, please remove the `rebase-merge/done` file and subfolder, then try `git status`. – Marina Liu Jul 13 '17 at 09:45
  • Updated the question. Even if I switch to another branch I still get the error. I do need to recover from the situation somehow as some of my branches aren't pushed to a remote :( – UserControl Jul 13 '17 at 10:12
  • Didn't you delete the `rebase-merge` folder and file in it? It is generated when you cherry-pick a commit while some error occur. So it's useless. – Marina Liu Jul 13 '17 at 10:44
  • I never touch `.git` folder. – UserControl Jul 13 '17 at 11:18
  • `.git` folder was auto generated when you initial a git repo, it's the place where commit history, log, hooks etc stored in. I mean the `rebase-merge` folder is useless. And when your git repo works fine again, you will find the `rebase-merge` folder is gone. – Marina Liu Jul 13 '17 at 14:23

1 Answers1

1

Found the answer here:

git rebase --abort

That did the trick.

UserControl
  • 14,766
  • 20
  • 100
  • 187