github/gitignore · Angular.gitignore

Angular .gitignore Template Explained

Why Angular.gitignore ignores dist, the .angular cache, out-tsc and coverage, and when to remove the rules that ignore lockfiles (package-lock.json, yarn.lock).

Open in generator Open with Node, VisualStudioCode, macOS

Angular.gitignore blocks build output and caches of Angular CLI projects. Most rules start with / and apply only at the workspace root.

One thing to watch is that it ignores /package-lock.json and /yarn.lock. npm recommends putting the lockfile under source control, so for applications it is common to remove these two lines.

Rules explained

PatternWhat it ignores and why
/dist//out-tsc//tmp/Build outputng build output, intermediate TypeScript compilation output and the temp folder.
/.angular/.angular/Angular CLI cacheThe disk cache Angular CLI uses to speed up builds. Having both a root-anchored rule and an any-depth rule also blocks caches of sub-projects.
/coverage//e2e/test-output/Test resultsKarma and Jest coverage and E2E test results.
/node_modules//package-lock.json/yarn.lockDependencies and lockfilesnode_modules obviously should be excluded, but if lockfiles are excluded too, dependency versions can differ on every install.
/.env/.angular-cli.json/.ng/Environment and settingsEnvironment variable files and old Angular CLI config files and folders.
*.tsbuildinfonpm-debug.log*yarn-debug.log*yarn-error.log*Logs and build infoTypeScript incremental build information and package manager logs.

Practical notes

Original template

Angular.gitignore17 rules
# Angular specific/dist//out-tsc//tmp//coverage//e2e/test-output//.angular/.angular/# Node modules and dependency files/node_modules//package-lock.json/yarn.lock# Environment files/.env# Angular CLI and build artefacts/.angular-cli.json/.ng/# TypeScript cache*.tsbuildinfo# Logsnpm-debug.log*yarn-debug.log*yarn-error.log*

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

Often used together

More template explanations