#問題
特に何もしていないのにgit statusで変更が記録されてしまう。
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: .dart_tool/flutter_build/0a841d3e0c969c64421ac67442114662/.filecache
modified: .dart_tool/flutter_build/0a841d3e0c969c64421ac67442114662/debug_android_application.stamp
modified: .dart_tool/flutter_build/0a841d3e0c969c64421ac67442114662/flutter_assets.d
modified: .flutter-plugins-dependencies
modified: .idea/workspace.xml
modified: build/app/intermediates/flutter/debug/flutter_build.d
#解決策
git rm -r --cached .dart_tool/flutter_build/0a841d3e0c969c64421ac67442114662/.filecache
git rm -r --cached .dart_tool/flutter_build/0a841d3e0c969c64421ac67442114662/debug_android_application.stamp
git rm -r --cached .dart_tool/flutter_build/0a841d3e0c969c64421ac67442114662/flutter_assets.d
git rm -r --cached .flutter-plugins-dependencies
git rm -r --cached .idea/workspace.xml
git rm -r --cached build/app/intermediates/flutter/debug/flutter_build.d
git add .
git commit -m ".gitignoreを反映"
gitignore
.DS_Store
.dart_tool/
.packages
.pub/
build/
.flutter-plugins
.flutter-plugins-dependencies
ios/Flutter/flutter_export_environment.sh
ios/Flutter/.last_build_id
# IntelliJ related
*.iml
*.ipr
*.iws
.idea/
参考:https://awesome-linus.com/2019/03/01/how-to-reflect-gitignore/