Dart .gitignore Template
Dart SDK packages, pub cache, build outputs, and doc generation. Generated and merged deterministically with upstream GitHub repository patterns to keep your repository clean of package directories, temporary build artifacts, and local environment files.
Interactive Stack Generator
Open in Full GeneratorDart SDK packages, pub cache, build outputs, and doc generation
### Dart #### See https://www.dartlang.org/guides/libraries/private-files # Files and directories created by pub.dart_tool/.packagesbuild/# If you're building an application, you may want to check-in your pubspec.lockpubspec.lock # Directory created by dartdoc# If you don't generate documentation locally you can remove this line.doc/api/ # dotenv environment variables file.env* # Avoid committing generated Javascript files:*.dart.js# Produced by the --dump-info flag.*.info.json# When generated by dart2js. Don't specify *.js if your# project includes source files written in JavaScript.*.js*.js_*.js.deps*.js.map .flutter-plugins.flutter-plugins-dependencies Raw Dart .gitignore
Crawlable upstream source template# See https://www.dartlang.org/guides/libraries/private-files # Files and directories created by pub.dart_tool/.packagesbuild/# If you're building an application, you may want to check-in your pubspec.lockpubspec.lock # Directory created by dartdoc# If you don't generate documentation locally you can remove this line.doc/api/ # dotenv environment variables file.env* # Avoid committing generated Javascript files:*.dart.js# Produced by the --dump-info flag.*.info.json# When generated by dart2js. Don't specify *.js if your# project includes source files written in JavaScript.*.js*.js_*.js.deps*.js.map .flutter-plugins.flutter-plugins-dependencies Key Pattern Breakdown
Dependencies & Packages
Excludes installed package directories and third-party vendor files that should be restored via package managers.
Build & Compilation Artifacts
Ignores compiled binaries, intermediate object files, and build output directories generated during development.
Environment & Secrets
Prevents leaking sensitive local credentials, API keys, database URLs, and environment configuration files.
Source & Verification
Place this file in the root directory of your project as .gitignore. Changes take effect on newly added or untracked files.