Git pull失败:您有未分离的更改。 Git状态:没有提交(工作目录清理) [英] Git pull fails: You have unstaged changes. Git status: nothing to commit (working directory clean)

查看:375
本文介绍了Git pull失败:您有未分离的更改。 Git状态:没有提交(工作目录清理)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当试图做一个git pull时,我会得到你没有进行更改。当我做git状态时,它说:没有提交(工作目录干净)。为什么?

我可以做一个git reset --hard,然后拉,但我不明白为什么pull第一次失败。

解决方案

正如@ J-16 SDiZ所说的,做一个 git status 。我发现一个常见的问题是,人们从他们的项目中删除一个文件,而不用从 git rm >从git中删除它。因此, git status 可以给你一个这样的文件列表,如果有的话,请继续操作:

git rm



为每个这样的文件。

然后提交您的更改并重试。


When trying to do a git pull I get "You have unstaged changes.". When I do a git status it says: nothing to commit (working directory clean). Why?

I can do a git reset --hard, then pull, but I don't understand why pull fails in the first time.

解决方案

As @J-16 SDiZ said, do a git status. I find a common problem is that people delete a file from their project without deleting it from git with git rm. So git status can give you a list of such files, and if it does, go ahead and just do:

git rm <copy_paste_filename_here>

for each such file.

Then commit your changes and try again.

这篇关于Git pull失败:您有未分离的更改。 Git状态:没有提交(工作目录清理)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆