.gitignore for Strapi

67 ignore rules for Strapi, ready to copy into your repository.

Headless CMS

The complete .gitignore for Strapi

# Generated by LFGitignore - https://lfgitignore.com
# Created: 2026-08-05 01:30:04 UTC
# Technologies: Strapi

### Strapi ###
# macOS folder settings (Desktop Services Store)
.DS_Store
# macOS resource fork files
.AppleDouble
# macOS custom folder icon
.LSOverride
Icon
# macOS Spotlight index
.Spotlight-V100
# macOS trash folder
.Trashes
# macOS resource fork files
._*
# Emacs backup files
*~
# Windows thumbnail cache
Thumbs.db
# Windows enhanced thumbnail cache
ehthumbs.db
Desktop.ini
# Windows recycle bin
$RECYCLE.BIN/
# Windows cabinet archive
*.cab
# Windows installer package
*.msi
# Windows merge module
*.msm
# Windows patch file
*.msp
# 7-Zip archive
*.7z
*.csv
*.dat
# macOS disk image
*.dmg
# Gzip compressed file
*.gz
# ISO disk image
*.iso
# Java archive
*.jar
# RAR archive
*.rar
# Tape archive
*.tar
# ZIP archive
*.zip
*.com
# Java compiled class file
*.class
# Dynamic link library
*.dll
# Windows executable
*.exe
# Object file
*.o
# Random seed file
*.seed
# Shared object
*.so
# Vim swap overflow file
*.swo
# Vim swap file
*.swp
# Vim additional swap file
*.swn
# Vim additional swap file
*.swm
# Compiler output
*.out
# Process ID file
*.pid
.tmp
# Log file
*.log
# SQL script
*.sql
# SQLite database
*.sqlite
*
.idea
nbproject
# Visual Studio Code settings
.vscode/
# Library coverage
lib-cov
lcov.info
# Process ID files
pids
logs
results
build
node_modules
.node_history
package-lock.json
**/package-lock.json
!docs/package-lock.json
*.heapsnapshot
testApp
# Coverage directory
coverage
cypress/screenshots
cypress/videos
dist
packages/strapi-generate-new/files/public/
.dev
front-workspace.code-workspace

What these Strapi rules actually ignore

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

OS X

Pattern What it ignores
.DS_Store macOS folder settings (Desktop Services Store)
.AppleDouble macOS resource fork files
.LSOverride macOS custom folder icon
Icon OS X
.Spotlight-V100 macOS Spotlight index
.Trashes macOS trash folder
._* macOS resource fork files

Linux

Pattern What it ignores
*~ Emacs backup files

Windows

Pattern What it ignores
Thumbs.db Windows thumbnail cache
ehthumbs.db Windows enhanced thumbnail cache
Desktop.ini Windows
$RECYCLE.BIN/ Windows recycle bin
*.cab Windows cabinet archive
*.msi Windows installer package
*.msm Windows merge module
*.msp Windows patch file

Packages

Pattern What it ignores
*.7z 7-Zip archive
*.csv Packages
*.dat Packages
*.dmg macOS disk image
*.gz Gzip compressed file
*.iso ISO disk image
*.jar Java archive
*.rar RAR archive
*.tar Tape archive
*.zip ZIP archive
*.com Packages
*.class Java compiled class file
*.dll Dynamic link library
*.exe Windows executable
*.o Object file
*.seed Random seed file
*.so Shared object
*.swo Vim swap overflow file
*.swp Vim swap file
*.swn Vim additional swap file
*.swm Vim additional swap file
*.out Compiler output
*.pid Process ID file

Logs and databases

Pattern What it ignores
.tmp Logs and databases
*.log Log file
*.sql SQL script
*.sqlite SQLite database

Misc.

Pattern What it ignores
* Misc.
.idea Misc.
nbproject Misc.
.vscode/ Visual Studio Code settings

Node.js

Pattern What it ignores
lib-cov Library coverage
lcov.info Node.js
pids Process ID files
logs Node.js
results Node.js
build Node.js
node_modules Node.js
.node_history Node.js
package-lock.json Node.js
**/package-lock.json Node.js
!docs/package-lock.json Node.js
*.heapsnapshot Node.js

Tests

Pattern What it ignores
testApp Tests
coverage Coverage directory
cypress/screenshots Tests
cypress/videos Tests

Documentation

Pattern What it ignores
dist Documentation

Builds

Pattern What it ignores
packages/strapi-generate-new/files/public/ Builds

Example app

Pattern What it ignores
.dev Example app

Visual Studio Code

Pattern What it ignores
front-workspace.code-workspace Visual Studio Code

How to use this .gitignore for Strapi

  1. Copy the Strapi 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