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

前端 未结 6 1998
孤街浪徒
孤街浪徒 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条回答
  •  猫巷女王i
    2020-12-30 19:28

    Many times i have faced such issues when my team mate works on Linux/Windows or uses git send-email.

    I always used to follow below command.

    git apply -3 --whitespace=fix yourpatch.patch
    

    or

    git am -s -3 --whitespace=fix yourpatch.patch
    

    -3 option will try three-way merge and it will help to solve other issues also.

提交回复
热议问题