Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git thinks files have changed

Tags:

git

windows

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?

like image 864
Dan Avatar asked Jun 05 '12 01:06

Dan


1 Answers

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 .
like image 68
Attila Szeremi Avatar answered Nov 09 '22 02:11

Attila Szeremi