Flutter: gitignore is... ignored

Viewed 506

I have a gitignore in my root folder, next to lib, ios, android, build... folders.

Inside it I have a bunch of ignored folders, one is build/ but every time I do some changes this folder appears again:

modified: build/ios/iphonesimulator/Runner.app/Frameworks/GTMAppAuth.framework/GTMAppAuth modified:build/ios/iphonesimulator/Runner.app/Frameworks/GTMSessionFetcher.framework/GTMSessionFetcher

I guess this has nothing to do with Flutter, that it's only Git, but this only happens with my Flutter projects, not with the rest

1 Answers

As mentioned in the comment,

  1. Remove the build directory entirely
  2. Add build to .gitignore
  3. Commit
  4. Build flutter again

They should no longer appear.

This likely happen because there's some part of build directory already committed before build was added to the .gitignore file.

Related