Flutter在Windows机器上使用LF作为行尾符。

6
我已经按照 Windows 安装推荐将 git 配置为 autocrlf=true。然而,当我运行 flutter pub get 命令时,我的 pubspeck.lock 文件的行尾符号仍是 lf。有没有一种方法可以配置 flutter 来遵守 clrf 设置?
# git status
On branch develop
Your branch is up to date with 'origin/develop'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   pubspec.lock

no changes added to commit (use "git add" and/or "git commit -a")

# git diff pubspec.lock
warning: LF will be replaced by CRLF in pubspec.lock.
The file will have its original line endings in your working directory

1
听起来你需要阅读这个... https://dev59.com/WYfca4cB1Zd3GeqPh2DG - JoelFan
3
点击您提供的链接很有帮助,我不需要使用.gitattribute文件。我所要做的只是通过输入git add --renormalize .来对我的代码库进行重标准化。 - Ebsan
2个回答

3

根据OP所述,解决方案如下:

git add --renormalize .

0

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接