问题描述:
git commit
时收到警报:
warning: LF will be replaced by CRLF in XXX.js. The file will have its original line endings in your working directory.
原因:
- git配置了
autocrlf = true
- 且文件中具有LF, 所以git会警告换行符不统一, 需要手动转换
解决方案:
- 之一: 手动把所有文档的换行符都转为统一
- 之一: 全局配置git:
git config --global core.autocrlf false