.gitignore Generator
Pick your languages, frameworks, operating system and editor to build a clean .gitignore file in seconds.
How to use the .gitignore Generator
- Pick your templatesTap the languages and frameworks your project uses, plus your operating system and editor. Use the search box to find one quickly.
- Add your own rulesType extra patterns, such as uploads/ or *.csv, one per line. Duplicate rules from several templates are removed.
- Copy or downloadDownload the file and save it as .gitignore in the root folder of your repository.
Example
Choosing Node, macOS, Windows, VS Code and Secrets gives a file that ignores node_modules/, .DS_Store, Thumbs.db and .env, but keeps .env.example.
Rules starting with ! un-ignore a file: !.vscode/settings.json keeps shared editor settings while ignoring the rest of .vscode/.
Frequently asked questions
Why are files I ignored still in Git?
.gitignore only affects files Git is not tracking yet. For files already committed, run git rm --cached <file> (or -r for a folder), then commit.
Where should the .gitignore file go?
In the root folder of your repository. You can also add .gitignore files in subfolders; their rules apply to that folder only.
Should I ignore .env files?
Yes. .env files usually hold passwords and API keys. Commit a .env.example with the same keys but no real values, so others know what to set.