Flutter: gitignore is... ignored

231

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.

Share:
231
Dani
Author by

Dani

for (1 < 2) { eat(); code(); for (true === true) { beer(); } sleep(); }

Updated on December 30, 2022

Comments

  • Dani
    Dani over 1 year

    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

    • BinHong
      BinHong almost 3 years
      Is gitignore already committed with the build directory in it? If not, try removing the build directory entirely, add build to gitignore, commit, then trying building flutter again. They should no longer appear.
    • Dani
      Dani almost 3 years
      yeah, it was that. Removing again the build folder did the trick. It doesn't ignore it by default. Feel free to move that to an answer