【发布时间】:2017-07-13 09:01:30
【问题描述】:
我有一个本地全新的分支,我想挑选一些提交。一些选择运行正常,但下一个产生了冲突:
>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'
所以我试着看看出了什么问题并得到了这个:
>git status
On branch MyBranch
fatal: Could not open file .git/rebase-merge/done for reading: No such file or directory
这是什么意思?我的仓库坏了?我该如何解决?
更新: 按照建议运行:
>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
更新 2: 这是 .git/rebase-merge 文件夹的内容:
git-rebase-todo
git-rebase-todo.backup
head-name
interactive
onto
orig-head
quiet
附言
git 版本 2.10.1.windows.1
【问题讨论】:
-
如果你使用
git cherry-pick --abort停止选择提交676b371,然后使用git status检查你的git repo 的状态是什么?如果你的工作目录是干净的,那么通过git cherry-pick 676b371挑选提交。 -
@Marina-MSFT,谢谢,更新了我的问题。
-
请检查您的
.git文件夹并查找您是否有文件.git/rebase-merge/done。如果有,请删除rebase-merge/done文件和子文件夹,然后尝试git status。 -
更新了问题。即使我切换到另一个分支,我仍然会收到错误消息。我确实需要以某种方式从这种情况中恢复过来,因为我的一些分支没有被推送到远程:(
-
你不是删除了
rebase-merge文件夹和里面的文件吗?当您在发生某些错误时选择提交时会生成它。所以没用。
标签: git version-control cherry-pick