I have cloned a repository that had inconsistend line endings. I have added a .gitattributes that sets the text attribute for the files I want to normalize. Now
Make sure you have no any pending changes in repository:
$ git status
$ git stash
Modify .gitattributes so CRLF interpretation will changed:
$ echo "*.txt text" >>.gitattributes
$ git commit -m "Made .txt files a subject to CRLF normalization." -- .gitattributes
Remove data from index and refresh working directory:
$ git rm --cached -r .
$ git reset --hard
Review CRLF fixes that Git proposes:
$ git ls-files --eol
$ git status
$ git diff
Agree with Git decision:
$ git add -u
$ git commit -m "Normalized CRLF for .txt files"
Reload changes as if clean clone was done:
$ git rm --cached -r .
$ git reset --hard