Ben*_*jol 44 git whitespace newline
请你解释一下git中的空白错误,它们是什么意思,什么是'压抑',我需要担心吗?
(运行msysgit,但在linux上与其他用户一起运行).
autocrlf 在这里已经有一个'明确'的答案(设置为false git config --global core.autocrlf false
)
Von*_*onC 28
静噪最初是在电信中用于设置阈值的函数,高于该阈值信号是否全部通过.
在你的情况下,当你看到:
warning: squelched 104 whitespace errors
warning: 109 lines add whitespace errors.
Run Code Online (Sandbox Code Playgroud)
这意味着:它不是显示100多个错误消息,而是警告你它应该显示那些错误(但它不会,为了不混淆输出)
我没有关于空白政策的确切建议,除了从一开始就确定它们的原因.
如果您的编辑器没有在Window和Unix之间转换eol(行尾)字符,那么它意味着它以某种方式自动添加或删除空格,这并不总是有用.
第一个测试(如本博客文章中所述)是取消激活策略:
git config core.whitespace nowarn
Run Code Online (Sandbox Code Playgroud)
或尝试
git config core.whitespace fix
Run Code Online (Sandbox Code Playgroud)
并查看是否有助于您的rebase操作.
Vin*_*nce 17
以下是使用git apply时如何修复"尾随空格"错误:
您需要知道的第一件事是:什么是空白错误.这在core.whitespace设置文档中有说明.基本上,git处理几种空白错误:
blank-at-eol
blank-at-eof
space-before-tab
indent-with-non-tab
tab-in-indent
cr-at-eol
Run Code Online (Sandbox Code Playgroud)
使用Windows样式行结尾(CRLF)修补文件时,尾随空白错误可能会上升.要避免此警告,您可以要求git apply不显示警告:
git apply --whitespace=nowarn fix.patch
Run Code Online (Sandbox Code Playgroud)
或者您也可以编辑git的配置上飞(含-c)说"OK混帐,CR在行尾都很好这次":
git -c core.whitespace=cr-at-eol apply fix.patch
Run Code Online (Sandbox Code Playgroud)
如果你想让它永久化,只需编辑git配置:
git config apply.whitespace nowarn
Run Code Online (Sandbox Code Playgroud)
要么 :
git config core.whitespace cr-at-eol
Run Code Online (Sandbox Code Playgroud)
小智 13
在搜索了那个答案并查看git-config和git-apply手册后,我发现了这一点
git config apply.whitespace nowarn
Run Code Online (Sandbox Code Playgroud)
停用显示当前存储库中的空白错误.
要使其可用于所有存储库,只需添加--global如下:
git config --global apply.whitespace nowarn
Run Code Online (Sandbox Code Playgroud)