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

Question:

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

I then followed the instructions at http://git-scm.com/docs/gitattributes#_checking-out_and_checking-in

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.

Answer:

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

Leave a Reply