广大V友有没有同时在mac, linux上使用git遇到烦人的^M问题,
我设置git config --global core.autocrlf true, 每次提交都有waring说要显式转换成crlf, 也很烦人。不知道有没有好的办法没有?
我设置git config --global core.autocrlf true, 每次提交都有waring说要显式转换成crlf, 也很烦人。不知道有没有好的办法没有?
|
hanaiJul 8, 2014
1
木有碰到,编辑器的问题?
|
|
yangqiJul 8, 2014
2
这个应该在编辑器端自动解决掉
|
|
47jm9ozpJul 8, 2014
3
dos2unix
? |
|
4
https://help.github.com/articles/dealing-with-line-endings
正常情况下,在非 windows 系统下不要把它设成 true。 |
|
7
unix LF only (each line ends with an LF character).
dos CRLF (each line ends with two characters, CR then LF). mac CR only (each line ends with a CR character). CR = ^M |
|
8
而且是多人协作,有些人用windows, 不能强制每个人用同样的编辑器同样的设置。
|
|
dorentusJul 8, 2014 via iPad
9
Mac 十多年前就不是 CR 了,现在是 LF。
|
|
lighteningJul 8, 2014
13
@maga Mac OS 9 之前才用 CR,现在早就换成 UNIX 的 LF 了。
|
|
vietorJul 8, 2014
14
眼不见心不烦——遇到^M基本上都是合并出冲突的时候,每次都沿用文件之前的换行符。
|
|
15
http://editorconfig.org/ please.
|
|
superbearJul 8, 2014
16
在mac或Linux下开发提交就不会出现这种情况吧
|