当我尝试从 git 中 pull 数据时,出现以下错误
Pull is not possible because you have unmerged files.
Please, fix them up in the work tree, and then use 'git add/rm <file>'
as appropriate to mark resolution, or use 'git commit -a'.
我曾尝试 stash 更改,但在 stash pull 不起作用后,请求 merge 。
如何在不提交/添加现有内容的情况下提取更改?
最佳答案
首先备份冲突的文件!
然后执行:
git fetch origin
git reset --hard origin/master (or your branch name)
如果你想恢复冲突文件或比较它们,你应该通过这种方式获得完整的 git 存储库代码。
关于Git pull 是不可能的,因为你有未 merge 的文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29967299/