首页 > 解决方案 > git --renormalize 没有效果

问题描述

我有一些以 LF 结尾的文件存储在 git 中。不知何故,它在我的工作树中转换为 CRLF。我想重新规范化它,即将它转换回LF。其他答案让我相信我可以使用git add --renormalize,但它根本没有做任何事情:

$ git config --global core.autocrlf
input

$ git check-attr -a myfile
myfile: text: auto

$ file myfile
myfile: ASCII text, with CRLF line terminators

$ git add --renormalize myfile
$ git status
On branch master
nothing to commit, working tree clean

$ file myfile
myfile: ASCII text, with CRLF line terminators

我错过了什么?我正在使用 Git 2.28.0。

标签: git

解决方案


推荐阅读