今天在打Patch的时候遇到了以下warnning:
new blank line at EOF. + warning: 1 line adds whitespace errors.
解决方法:
现象:
git am someone.patch
Applying: ...
/workingfolder/.git/rebase-apply/patch:50: trailing whitespace.
--
...
warning: squelched 3 whitespace errors
warning: 6 lines applied after fixing whitespace errors.
===============================
原因:
告警的含义是提示有空格在行尾出现。
检查后的确有空格在行尾。
===============================
具体方法:
1. git reset --hard <前一个commit id>
2. git am --reject --whitespace=fix /someone.patch
3. git format-patch -01 重新制作补丁,然后利用
vimdiff检查一下,是否已修正。
原文链接:https://blog.csdn.net/haoyujie/java/article/details/100014149