简体   繁体   中英

git thinks files have changed

I did some work on a project on one machine, then pushed to github and, on another machine, cloned and did some work, then pushed. Then I went back to the first machine and did a pull . Now the first machine thinks all the files that were in the project originally were changed. I've tried

git checkout -f --

and

git rm --cached -r .
git checkout -f

and even tried

git stash

but no matter what I do, git status tells me those files have been changed. How do I make it stop?

This seems to be a line-ending/autocrlf issue. A great trick I realized for fixing this (if your index doesn't matter) is:

$ git add -u .
$ git reset .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM