Board logo

标题: 可否净系用git解决CRLF问题? [打印本页]

作者: 3ldk    时间: 2026-2-4 14:14     标题: 可否净系用git解决CRLF问题?

我个project有CRLF问题, 而家系一个commit都未有, 想系第一个commit之前转晒LF先commit入去

我知道core.autocrlf true可以将commit的内容自动转晒做LF, 但唔会转外面的file, 而且其他人checkout时, 又会自动将LF转返做CRLF, 所以系治标不治本

所以我希望系commit之前将成个project入面的file转晒做LF来彻底解决问题, 单靠git有可能做到吗?
如果无, 有无linux command可以一句转换所有file的CRLF?

同埋唔明unlock index即系做乜?

[attach]2514056[/attach]
作者: rkkc    时间: 2026-2-4 15:20

  1. git config --global core.autocrlf input
复制代码
commit 乜都会转 lf, checkout 时唔会变返 crlf
** system/global/local scope 自己拣啱
作者: javacomhk    时间: 2026-2-5 06:19

Google AI Search 都唔用?

[attach]2514104[/attach]





欢迎光临 电脑领域 HKEPC Hardware (https://global.hkepc.com/forum/) Powered by Discuz! 7.2