github/gitignore · Flutter.gitignore

Flutter .gitignore Template Explained

Why Flutter.gitignore ignores .dart_tool, build, platform-specific generated files and signing keys, and the problem of the *.lock rule also blocking pubspec.lock.

Open in generator Open with Dart, VisualStudioCode, macOS, Android

Flutter.gitignore broadly covers the Dart tool folder, build output, and the files Flutter auto-generates inside the Android, iOS, macOS, Windows and Linux platform folders. It is characterized by heavy use of **, as in **/ios/**/Pods/.

The template also contains paths from the Flutter SDK repository itself, such as /bin/cache/ and /dev/bots/. App repositories do not have those paths, so they do no harm, but note that the .gitignore generated by flutter create fits apps better.

Rules explained

PatternWhat it ignores and why
.dart_tool/.packages.pub/.flutter-plugins.flutter-plugins-dependenciesDart and pub toolsFiles that flutter pub get recreates, such as package resolution results and the plugin list.
build/coverage/app.*.symbolsBuild outputflutter build output, test coverage, and symbol files from obfuscated builds.
*.lockAll lock filesIgnores every .lock file. As a result, pubspec.lock, Podfile.lock and Gemfile.lock are excluded too. The rule suits the SDK repository but usually not apps.
**/android/local.properties**/android/key.properties*.jks**/android/**/GeneratedPluginRegistrant.java**/android/gradlewAndroid generated files and secretsAuto-generated or secret files, such as local.properties with the SDK path, key.properties with signing passwords, keystores, and plugin registration code.
**/ios/**/Pods/**/ios/Flutter/Generated.xcconfig**/ios/Runner/GeneratedPluginRegistrant.***/ios/**/xcuserdata**/macos/Flutter/ephemeraliOS and macOS generated filesCocoaPods install output, the xcconfig Flutter writes on every build, plugin registration code and Xcode user state.
**/windows/flutter/generated_plugin_registrant.cc**/linux/flutter/generated_plugins.cmakeDesktop plugin registration codeC++ and CMake files auto-generated to wire up plugins in Windows and Linux builds.
*.log*.pyc*.swp.historyOtherLogs, tool caches and editor temporary files.

Practical notes

Original template

Flutter.gitignore94 rules
# Miscellaneous*.class*.lock*.log*.pyc*.swp.buildlog/.history# Flutter repo-specific/bin/cache//bin/internal/bootstrap.bat/bin/internal/bootstrap.sh/bin/mingit//dev/benchmarks/mega_gallery//dev/bots/.recipe_deps/dev/bots/android_tools//dev/devicelab/ABresults*.json/dev/docs/doc//dev/docs/flutter.docs.zip/dev/docs/lib//dev/docs/pubspec.yaml/dev/integration_tests/**/xcuserdata/dev/integration_tests/**/Pods/packages/flutter/coverage/versionanalysis_benchmark.json# packages file containing multi-root paths.packages.generated# Flutter/Dart/Pub related**/doc/api/.dart_tool/.flutter-plugins.flutter-plugins-dependencies**/generated_plugin_registrant.dart.packages.pub-preload-cache/.pub/build/flutter_*.pnglinked_*.dsunlinked.dsunlinked_spec.ds# Android related**/android/**/gradle-wrapper.jar.gradle/**/android/captures/**/android/gradlew**/android/gradlew.bat**/android/local.properties**/android/**/GeneratedPluginRegistrant.java**/android/key.properties*.jks# iOS/XCode related**/ios/**/*.mode1v3**/ios/**/*.mode2v3**/ios/**/*.moved-aside**/ios/**/*.pbxuser**/ios/**/*.perspectivev3**/ios/**/*sync/**/ios/**/.sconsign.dblite**/ios/**/.tags***/ios/**/.vagrant/**/ios/**/DerivedData/**/ios/**/Icon?**/ios/**/Pods/**/ios/**/.symlinks/**/ios/**/profile**/ios/**/xcuserdata**/ios/.generated/**/ios/Flutter/.last_build_id**/ios/Flutter/App.framework**/ios/Flutter/Flutter.framework**/ios/Flutter/Flutter.podspec**/ios/Flutter/Generated.xcconfig**/ios/Flutter/ephemeral**/ios/Flutter/app.flx**/ios/Flutter/app.zip**/ios/Flutter/flutter_assets/**/ios/Flutter/flutter_export_environment.sh**/ios/ServiceDefinitions.json**/ios/Runner/GeneratedPluginRegistrant.*# macOS**/Flutter/ephemeral/**/Pods/**/macos/Flutter/GeneratedPluginRegistrant.swift**/macos/Flutter/ephemeral**/xcuserdata/# Windows**/windows/flutter/generated_plugin_registrant.cc**/windows/flutter/generated_plugin_registrant.h**/windows/flutter/generated_plugins.cmake# Linux**/linux/flutter/generated_plugin_registrant.cc**/linux/flutter/generated_plugin_registrant.h**/linux/flutter/generated_plugins.cmake# Coveragecoverage/# Symbolsapp.*.symbols# Exceptions to above rules.!**/ios/**/default.mode1v3!**/ios/**/default.mode2v3!**/ios/**/default.pbxuser!**/ios/**/default.perspectivev3!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages!/dev/ci/**/Gemfile.lock

Templates from github/gitignore/Flutter.gitignore @356fd7b (2026-09-11) · CC0-1.0

Often used together

More template explanations