My diff contains trailing whitespace - how to get rid of it?

前端 未结 6 1982
孤街浪徒
孤街浪徒 2020-12-30 19:20

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

6条回答
  •  無奈伤痛
    2020-12-30 19:31

    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.

提交回复
热议问题