[英]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
这些是 my.gitignore 中关于
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仍然
*.freezed.dart
和*.g.dart
再次添加
If I'm understanding your question correctly;如果我正确理解您的问题; if the files have been previously tracked by git then you need to remove the files then commit those changes to the repository to remove them from git but keeps the local copies.
如果文件之前已被 git 跟踪,那么您需要删除文件,然后将这些更改提交到存储库以将它们从 git 中删除,但保留本地副本。
>git rm -rf --cached .
>git add .
>git commit -m "remove ignored files"
Check if the *.freezed.dart
and *.g.dart
which keep getting added again are part of a nested repository, or a submodule folder.检查不断添加的
*.freezed.dart
和*.g.dart
是否是嵌套存储库或子模块文件夹的一部分。
In both cases (nested or submodule), the .gitignore
in the parent folder of those sub-repositories would not apply to said sub-repositories content.在这两种情况下(嵌套或子模块),这些子存储库的父文件夹中的
.gitignore
将不适用于所述子存储库内容。
So go in the parent folder of one of those files and type: git rev-parse --show-toplevel
所以 go 在这些文件之一的父文件夹中并键入:
git rev-parse --show-toplevel
I don't understand why, but I changed我不明白为什么,但我改变了
*.freezed.dart
*.g.dart
for为了
*.g.dart
*.freezed.dart
and it started working它开始工作
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.