6

I have my git configured to autocrlf=true as recommended for Windows installations. However, when I run flutter pub get my pubspeck.lock file keeps getting lf for line endings. Is there a way to configure flutter so it respects the clrf settings?

# 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
Ebsan
  • 758
  • 1
  • 10
  • 33
  • 1
    Sounds like you need to read this.... https://stackoverflow.com/questions/28224273/can-git-be-configured-to-not-perform-autocrlf-on-certain-files – JoelFan Jul 06 '20 at 21:55
  • 3
    Following your link helped. I didn't have to use a .gitattribute file. All I had to do was renormalize my repo by typing `git add --renormalize .` – Ebsan Jul 06 '20 at 22:07

2 Answers2

3

As stated by OP, the solution was:

git add --renormalize .
Lewis
  • 4,285
  • 1
  • 23
  • 36
0

This should help: LF will be replaced by CRLF in git - What is that and is it important?

TL;DR

do

git config core.autocrlf true
Yehuda
  • 457
  • 2
  • 6
  • 16