Sometimes git tells me EVERY file is new and unstaged?

蓝咒 提交于 2019-12-10 16:48:02

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/15345846/sometimes-git-tells-me-every-file-is-new-and-unstaged

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!