How do I force git to checkout the master branch and remove carriage returns after I’ve normalized files using the “text” attribute?


Okay, so I added the file .gitattributes with lines like this

I then followed the instructions at

But now my working copy still has the carriage returns! I have untracked files that I would like to keep. How do I have git checkout the master branch again with the normalized files?

I know the files are normalized in the repository because when I clone the repo, I have all the files without the carriage returns.


Ah ah! Checkout the previous commit, then checkout the master.

Leave a Reply