有时候,git告诉我每个文件都是新的和非暂存的? [英] Sometimes git tells me EVERY file is new and unstaged?

查看:114
本文介绍了有时候,git告诉我每个文件都是新的和非暂存的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将对文件进行更改,转到GitHub for windows UI。提交我的更改,然后点击同步按钮。然后它说错误,请尝试使用shell。所以我进入shell并键入 git status 。它告诉我回购中的每个文件都是新的和未分离的。这有4,000个未分档的文件。



现在,这种情况发生在我身上的3次,在2台不同的计算机上,在不同的回购站,甚至是单独工作。这是一个常见的错误?有时候我会冒出一个孤立的头脑,或者一个.lock文件被拖得太久。发生什么事。每次都要花费我很长时间才能恢复。

解决方案

对于共享存储库的Windows用户,这通常是一个问题Unix用户并没有正确设置他们的Git或编辑器行尾设置。请参阅手册页以获取以下设置:


  • core.autocrlf

  • core.eol

  • core.whitespace



请参阅处理行结尾以获取更多信息。


I'll make a change to a file, go to the GitHub for windows UI. Commit my changes then hit the sync button. Then it says error, try using the shell instead. So I go to the shell and type git status. It tells me every file in the repo is new and unstaged. There's like 4,000 unstaged files.

This has happened to me 3 times now, on 2 different computers, on different repos, and even when working alone. Is this a common bug? Sometimes I get a detached head out of nowhere, or a .lock file is hanging around too long. What is happening. It takes me so long to recover from the mess each time.

解决方案

This is usually a problem for Windows users who share repositories with Unix users and haven't set up their Git or editor end-of-line settings properly. See the man page for the following settings:

  • core.autocrlf
  • core.eol
  • core.whitespace

See Dealing with line endings for more information.

这篇关于有时候,git告诉我每个文件都是新的和非暂存的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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