.gitignore for Firebase
17 ignore rules for Firebase, ready to copy into your repository.
App development platform
The complete .gitignore for Firebase
# Generated by LFGitignore - https://lfgitignore.com
# Created: 2026-08-05 01:28:16 UTC
# Technologies: Firebase
### Firebase ###
/firebase-debug.log
/firebase-debug.*.log
.firebaserc
/firebase.json
# Cache file
*.cache
hosting/.cache
/functions/node_modules/
/functions/.env
/functions/package-lock.json
/firebase-*.zip
/.firebase/
/emulator-ui/
# Log file
*.log
# npm debug logs
npm-debug.log*
# Yarn debug logs
yarn-debug.log*
/.env.*
# Yarn error logs
yarn-error.log*
What these Firebase rules actually ignore
Every pattern below, and why it belongs in your .gitignore.
Firebase build and deployment files
| Pattern | What it ignores |
|---|---|
/firebase-debug.log |
Firebase build and deployment files |
/firebase-debug.*.log |
Firebase build and deployment files |
.firebaserc |
Firebase build and deployment files |
Firebase Hosting
| Pattern | What it ignores |
|---|---|
/firebase.json |
Firebase Hosting |
*.cache |
Cache file |
hosting/.cache |
Firebase Hosting |
Firebase Functions
| Pattern | What it ignores |
|---|---|
/functions/node_modules/ |
Firebase Functions |
/functions/.env |
Firebase Functions |
/functions/package-lock.json |
Firebase Functions |
Firebase Emulators
| Pattern | What it ignores |
|---|---|
/firebase-*.zip |
Firebase Emulators |
/.firebase/ |
Firebase Emulators |
/emulator-ui/ |
Firebase Emulators |
Logs
| Pattern | What it ignores |
|---|---|
*.log |
Log file |
npm-debug.log* |
npm debug logs |
yarn-debug.log* |
Yarn debug logs |
yarn-error.log* |
Yarn error logs |
Environment files (local configs)
| Pattern | What it ignores |
|---|---|
/.env.* |
Environment files (local configs) |
How to use this .gitignore for Firebase
- Copy the Firebase rules above, or download the file directly.
- Create a file named .gitignore at the root of your Git repository and paste the rules into it.
- If some of those files are already tracked, run git rm -r --cached . then commit again — Git only applies ignore rules to untracked files.
- Commit the .gitignore so everyone on the team shares the same rules.