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.
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
| Pattern | What it ignores and why |
|---|---|
.dart_tool/.packages.pub/.flutter-plugins.flutter-plugins-dependencies | Dart and pub toolsFiles that flutter pub get recreates, such as package resolution results and the plugin list. |
build/coverage/app.*.symbols | Build outputflutter build output, test coverage, and symbol files from obfuscated builds. |
*.lock | All 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/gradlew | Android 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/ephemeral | iOS 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.cmake | Desktop plugin registration codeC++ and CMake files auto-generated to wire up plugins in Windows and Linux builds. |
*.log*.pyc*.swp.history | OtherLogs, tool caches and editor temporary files. |
Practical notes
- For apps, commit
pubspec.lockas the Dart documentation recommends. When using this template, add!pubspec.lockand!**/ios/Podfile.lockto your custom rules. - Never commit
key.propertiesor.jkskeystores. In CI, inject them from a secret store. - Selecting the Dart template as well also ignores
*.js, so if your web source contains JavaScript files, test the result.
Original template
Flutter.gitignore
# 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