.gitignore for macOS + Node + React + VS Code

Complete .gitignore for the typical React developer stack on macOS with VS Code.

Quick presets

Selected (4)
macOSNodeReactVisual Studio Code
Your selections never leave your browser. Generation happens entirely client-side.
Raw

48 patterns · 978 B

# Generated by DevZone Tools — https://devzone.tools/tools/gitignore-generator
# Templates: macOS, Visual Studio Code, Node, React
# 2026-04-20

# ---- macOS ----
# macOS
.DS_Store
.AppleDouble
.LSOverride
Icon
._*
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

# ---- Visual Studio Code ----
# Visual Studio Code
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
!.vscode/*.code-snippets
.history/
*.vsix

# ---- Node ----
# Node
node_modules/
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
.pnpm-debug.log*
.npm
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
lerna-debug.log*
.env
.env.local
.env.development.local
.env.test.local
.env.production.local
dist/
build/
.cache/
*.tsbuildinfo

# ---- React ----
# React
coverage/

Why use macOS + Node + React + VS Code together?

This is the quintessential modern web developer .gitignore. Most React developers work on macOS, use VS Code, and run Node.js. This four-template combination covers all the bases.

The VS Code template is carefully crafted to ignore user-specific workspace state (.vscode/settings.json is un-ignored by default since it often contains useful shared settings like formatter config). You can adjust this to fully ignore .vscode/ if your team prefers personal-only settings.

Frequently asked questions

Do I need to commit .gitignore?
Yes — .gitignore should be committed to the repository so all collaborators benefit from the same ignore rules.
How do I add custom patterns?
Open your .gitignore file and add the pattern on a new line. Use # for comments, * for wildcards, / to match directories, and ! to un-ignore a previously ignored path.
How do I ignore a file that is already tracked?
Adding a file to .gitignore does not remove it from tracking if it was previously committed. Run: git rm --cached <file> to stop tracking it without deleting the file locally.
Why combine macOS and Node and React and Visual Studio Code?
This is the quintessential modern web developer .gitignore. Most React developers work on macOS, use VS Code, and run Node.js. This four-template combination covers all the bases.

Looking for something else? Browse all templates →