Search code examples
gitgitignore

Freezed files are added to the commit, ignoring gitignore


These are the lines in my .gitignore concerning the files generated by flutter pub run build_runner build --delete-conflicting-outputs

*.freezed.dart
*.g.dart 

I tried

git rm -rf --cached .
git add .

and still *.freezed.dart and *.g.dart get added again


Solution

  • I don't understand why, but I changed

    *.freezed.dart
    *.g.dart 
    

    for

    *.g.dart 
    *.freezed.dart
    

    and it started working