Flutter, which folder not to commit to svn


Solution 1

Do android and ios folder need to commit to svn?

Yes, always comit these folders to svn(but you can skip some auto generated files)

There are three main folders in the Flutter project: lib, android and ios.

lib takes care of your Dart files. The Android and iOS folders exist to actually build an app on those respective platforms with the Dart files running on them. They also help you add permissions and platform-specific functionality to your project. When you run a Flutter project, it builds depending on which emulator or device it is running on, doing a Gradle or XCode build using the folders inside it.

In short, those folders are entire apps which set the stage for the Flutter code to run.

Don’t commit the following files and directories:

# See https://www.dartlang.org/tools/private-files.html

# Files and directories created by pub
# If you're building an application, you may want to check-in your pubspec.lock

# Directory created by dartdoc
# If you don't generate documentation locally you can remove this line.

From flutter create:


For more information please refer this to check which files are auto generated.

Hope this will helps you

Solution 2

If you create a Flutter project it contains 3 .gitignore files.
One in the project root and one in each ios/ and android/.
These files already cover most cases.


They unified these 3 .gitignore into a single one

# Miscellaneous

# IntelliJ related

# Visual Studio Code related

# Flutter/Dart/Pub related

# Android related

# iOS/XCode related

# Exceptions to above rules.
Author by


Full Stack Developer Sr. Manager

Updated on December 07, 2022


  • stuckedoverflow
    stuckedoverflow 28 days

    Do android and ios folder need to commit to svn?

    I believe /build .packages are not to be committed.

    I haven't found detailed docs on this topic. I only find this https://www.dartlang.org/guides/libraries/private-files

    I'm aware there is .gitignore file but I think this file is ignored because I'm using TortoiseSVN. Every time I commit I got like 200+ files committed. And may affect other users when they do update.

    enter image description here

  • stuckedoverflow
    stuckedoverflow about 4 years
    I only have 1 .gitignore on the root....And because I'm using svn I think this file is "ignored" too :)
  • Günter Zöchbauer
    Günter Zöchbauer about 4 years
    The last time I checked they were 3 but I remember seeing discussions that they should be merged and in a newly created project there is now only 1 such file. I updated my answer.
  • stuckedoverflow
    stuckedoverflow about 4 years
    Can I use svn to take this .gitignore file?
  • Günter Zöchbauer
    Günter Zöchbauer about 4 years
    There seems to be something similar stackoverflow.com/questions/11293539/…. You would need to convert it yourself
  • Alex Roy
    Alex Roy over 2 years
    what about ios/build/ folder, ios/Podfile and ios/Podfile.lock file?
  • Günter Zöchbauer
    Günter Zöchbauer over 2 years
    Lockfiles for application projects depends on your preferences. For published packages you usually should not commit them. Otherwise check github.com/flutter/gallery/blob/master/.gitignore That file is kept updated.