git,空白错误,压制和autocrlf,明确的答案 [英] git, whitespace errors, squelching and autocrlf, the definitive answers

查看:743
本文介绍了git,空白错误,压制和autocrlf,明确的答案的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请你可以解释一下git中的空白错误,它们是什么意思,什么是'压制',我需要担心它吗?

msysgit,但与其他用户在Linux上)。



autocrlf here (将其设置为false git config --global core.autocrlf false

解决方案

Squelching 最初是电信中用来设置一个阈值的函数,在该阈值以上信号是通过或不通过。

在你的情况下,当你看到:

 警告:压制104空格错误
警告:109行添加空格错误。

这意味着:不是显示100多条错误消息,而是警告你应该显示这些错误但它不会,以免混乱输出)



对于空白策略,我没有明确的建议,除非确定为什么首先引入它们。

如果您的编辑器不能在Window和Unix之间转换eol(行尾)字符,那么它意味着它会自动添加或删除空格,这并不总是有用。



第一个测试(如 blog post )将取消激活该政策:

  git config core.whitespace nowarn 

或尝试

  git config core.whitespace修复

并查看是否有助于您的rebase操作。


Please can you explain about whitespace errors in git, what do they mean, what is 'squelching', and do I need to worry about it?

(Running msysgit, but with other users on linux).

There is already a 'definitive' answer for autocrlf here (set it to false git config --global core.autocrlf false )

解决方案

Squelching is initially a function used in telecommunication to set a threshold above which a signal is or isn't alllowed through.

In your case, when you see:

warning: squelched 104 whitespace errors
warning: 109 lines add whitespace errors. 

It means: instead of displaying 100+ error messages, it warns you it should have displayed those errors (but it won't, in order to not clutter the output)

I have no definitive recommendations for whitespace policy, except from identifying why they are introduced in the first place.
If your editor doesn't convert the eol (end of lines) characters between Window and Unix, then it means it somehow add or remove automatically whitespaces, which is not always useful.

A first test (as in this blog post) is to de-activate the policy:

git config core.whitespace nowarn

or try

git config core.whitespace fix

and see if that facilitates your rebase operations.

这篇关于git,空白错误,压制和autocrlf,明确的答案的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆