Git提示The file will have its original line endings in your working directory.

Git提示The file will have its original line endings in your working directory.

Guooo
2018-02-07 / 1 评论 / 3,340 阅读 / 正在检测是否收录...

执行 git add提示的时候常常会提示

The file will have its original line endings in your working directory.

网上很多人都有这种情况,却都忽略。
因为它确实没有必要,只是Linux平台下的换行符是 LF,而Windows下则是 CRLF,所以当你再 Windows 保存文件时候,换行符会被保存为LF

不过看起来有一大串警告很不舒服

就这么解决吧

在git命令行里使用这一句,禁止自动转换换行符

git config --global core.autocrlf false
0

评论 (1)

取消
  1. 头像
    钟水洲博客
    Windows 10 · Google Chrome

    拜个早年

    回复