1. 程式人生 > >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’

折騰Hexo部落格有一陣子,每次提交的時候直接Hexo d後沒管,這次仔細看了提交時的輸出日誌,發現滿屏提示

warning: LF will be replaced by CRLF in xxxxx
The file will have its original line endings in your working directory.

之前一直沒在意,趁有空著手解決,原來是Git預設配置替換回車換行成統一的CRLF,我們只需要修改配置禁用該功能即可。
Gitshell中輸入如下命令解決:

git config –global core.autocrlf false

使用

git config –list

命令檢視Git所有配置。