Skip to content
language14 active rulesVerified 2026-09-30

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

Preconfigured with Dart
Search for templates
Quick add:
Selected1
Dart
Selected Templates (1)
.gitignore
14 rules
### Dart ###
# See https://www.dartlang.org/guides/libraries/private-files
# Files and directories created by pub
.dart_tool/
.packages
build/
# If you're building an application, you may want to check-in your pubspec.lock
pubspec.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
31 lines•UTF-8
Deterministic

Raw Dart .gitignore

Crawlable upstream source template
dart.gitignore•30 lines•UTF-8
# See https://www.dartlang.org/guides/libraries/private-files
# Files and directories created by pub
.dart_tool/
.packages
build/
# If you're building an application, you may want to check-in your pubspec.lock
pubspec.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 & Package Registries

External libraries and package manager directories installed locally rather than stored in version control.

.packages

Build Outputs & Compiled Artifacts

Generated binary files, compilation targets, and distribution bundles that can be reliably reproduced from source.

build/

Environment Secrets & Local Overrides

Local environment configurations, secrets, and credentials intended to protect developer-specific settings from exposure.

.env*

Source & Verification

License: CC0-1.0

Place this file in the root directory of your project as .gitignore. Changes take effect on newly added or untracked files.