I\'ve tried editing a php file in TextWrangler with line endings set to Unix, in NetBeans, and in vim. When I save the diff to a patch and then try to apply it, it gives whi
I think the question of how to cope with the whitespace has been adequately answered, but you asked where it came from. You mentioned ^M
at the ends of lines: that’s how Git shows Windows line endings. Maybe try running dos2unix
on your source files before creating patches, or use an editor which maintains the original line endings.