问题
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