Results are provided for informational purposes only and may contain errors. Please verify important information independently. Use of this tool is at your own risk.
What the .gitignore Generator does
The .gitignore Generator builds a .gitignore file from ready-made templates. Tick the languages, frameworks, editors and operating systems in your project and it combines their rules, each under a ### Name ### heading so you can see where every line came from. Node, macOS and VSCode are selected when the page opens.
Ten templates are available: Node, Python, Java, macOS, Windows, VSCode, IntelliJ, React, Ruby/Rails and Go. They cover dependency folders (node_modules/, .venv/, vendor/), build output (dist/, build/, target/), local environment files (.env) and editor or OS clutter (.DS_Store, Thumbs.db, .idea/). Copy the result into a file called .gitignore at the root of the repository.
When to use it
- Starting a new repository and keeping dependencies and build output out of the first commit.
- Stopping
.DS_StoreorThumbs.dbfrom appearing in every pull request. - Making sure
.envfiles with local secrets are never committed. - Adding rules for a second language when a project grows, for example a Python script in a Node repo.
Worked example
Input
Python + VSCode
Output
### Python ###
__pycache__/
*.py[cod]
*.egg-info/
.venv/
venv/
.env
dist/
build/
*.egg
### VSCode ###
.vscode/
*.code-workspaceCommon questions about the .gitignore Generator
I added a file to .gitignore but Git still tracks it. Why?
.gitignore only affects files that are not tracked yet. Remove the file from the index with git rm --cached path/to/file, commit, and from then on Git ignores it. The file stays on your disk.
Should editor folders like .vscode go in the project's .gitignore?
Teams often prefer a personal global ignore file for editor and OS clutter (git config --global core.excludesFile). Put them in the project file when you want every contributor protected without extra setup.
What does *.py[cod] mean?
Square brackets match one character from the set, so the pattern matches .pyc, .pyo and .pyd files, which are compiled Python files.
Can I un-ignore one file inside an ignored folder?
Yes, with a ! rule, such as !.vscode/settings.json. It only works if the folder itself is ignored with .vscode/* rather than .vscode/, because Git does not look inside a folder that is excluded as a whole.
Is this tool free?
Yes, it's free to use. No signup, no email required. Get results on this page.
How do I get my result?
Use the tool on this page. Your result appears here; no email delivery is required.