Dan
Dan

Reputation: 13210

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?

Upvotes: 5

Views: 2665

Answers (1)

Attila Szeremi
Attila Szeremi

Reputation: 5488

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 .

Upvotes: 6

Related Questions