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

Wit*_*tle 7 windows git dart flutter

我已按照 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
Run Code Online (Sandbox Code Playgroud)

C. *_*wis 4

正如OP所述,解决方案是:

git add --renormalize .
Run Code Online (Sandbox Code Playgroud)


归档时间:

查看次数:

1279 次

最近记录:

5 年,3 月 前