[转]解决Git apply时warning: 1 line adds whitespace errors.


今天在打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


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM