Mar 102012
When creating files in Windows, those files will have the DOS format.
This creates annoying ^M characters at the end of lines, which can be seen in patches or diff files.
In order to localize them, use this command:
find . -not -type d -exec file "{}" ";" | grep CRLF
It will give an output like this for dos files:
./example.txt: ASCII text, with CRLF line terminators
Then open them in emacs, and launch that command:
M-x set-buffer-file-coding-system RET undecided-unix
M-x means escape and X.
RET is return.
Then save your file and you are done.