.gitignore for Angular

17 ignore rules for Angular, ready to copy into your repository.

TypeScript-based web application framework

The complete .gitignore for Angular

# Generated by LFGitignore - https://lfgitignore.com
# Created: 2025-08-01 22:42:31 UTC
# Technologies: Angular

### Angular ###
/dist/
/out-tsc/
# Temporary directory
/tmp/
# Code coverage reports
/coverage/
/e2e/test-output/
/.angular/
.angular/
/node_modules/
/package-lock.json
/yarn.lock
/.env
/.angular-cli.json
/.ng/
# TypeScript build info
*.tsbuildinfo
# npm debug logs
npm-debug.log*
# Yarn debug logs
yarn-debug.log*
# Yarn error logs
yarn-error.log*

What these Angular rules actually ignore

Every pattern below, and why it belongs in your .gitignore.

Angular specific

Pattern What it ignores
/dist/ Angular specific
/out-tsc/ Angular specific
/tmp/ Temporary directory
/coverage/ Code coverage reports
/e2e/test-output/ Angular specific
/.angular/ Angular specific
.angular/ Angular specific

Node modules and dependency files

Pattern What it ignores
/node_modules/ Node modules and dependency files
/package-lock.json Node modules and dependency files
/yarn.lock Node modules and dependency files

Environment files

Pattern What it ignores
/.env Environment files

Angular CLI and build artefacts

Pattern What it ignores
/.angular-cli.json Angular CLI and build artefacts
/.ng/ Angular CLI and build artefacts

TypeScript cache

Pattern What it ignores
*.tsbuildinfo TypeScript build info

Logs

Pattern What it ignores
npm-debug.log* npm debug logs
yarn-debug.log* Yarn debug logs
yarn-error.log* Yarn error logs

How to use this .gitignore for Angular

  1. Copy the Angular rules above, or download the file directly.
  2. Create a file named .gitignore at the root of your Git repository and paste the rules into it.
  3. If some of those files are already tracked, run git rm -r --cached . then commit again — Git only applies ignore rules to untracked files.
  4. Commit the .gitignore so everyone on the team shares the same rules.

Other Framework .gitignore templates

See every Framework template