0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

後から追加でgitignoreしたいときメモ

Posted at

#問題

特に何もしていないのに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/

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?