Git pull 是不可能的,因为你有未 merge 的文件

标签 git

当我尝试从 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/

相关文章:

git - 如何在 Android 源代码树中显示可用的分支?

git - 我如何对包含 ">"的字符串进行 git grep?

git - 如何分块推送 Git 镜像?

git - 如何获取 GitChangeSet 对象的存储库名称或 URL?

git - 确定传入 HTTP 请求的 VCS

Git rebase 不断失败,需要手动 merge 干预

git - 使用 Dropbox 同步本地 git repo

git - Jenkins 管道中的 changeSet 错误(错误 :java. io.NotSerializableException : hudson. plugins.git.GitChangeSetList)

git - 如何在 git 存储库中恢复损坏的对象(对于新手)?

git-bisect 创建修改后的文件