.gitignore Generator
Select one or more technology templates and combine them into a single .gitignore file. Download or copy to clipboard in one click.
Select templates
Frequently Asked Questions
What is a .gitignore file?
A .gitignore file tells Git which files and folders to ignore in a repository. It prevents generated files, secrets, and OS-specific artifacts from being committed.
Can I combine multiple templates?
Yes. Select any combination of language and OS templates and the tool will merge them into a single, deduplicated .gitignore file.
Where should I put the .gitignore file?
Place it in the root directory of your Git repository. Git will then respect it for all paths within that repository.
Can I add my own custom rules?
After downloading, open the file in any text editor and append your custom patterns. Each line is a separate pattern, and lines starting with # are comments.
What Does .gitignore Do?
A .gitignore file tells Git which files and directories to exclude from version control. Ignored files will not appear in git status, won't be staged by git add ., and will never be committed to the repository โ protecting secrets, build artifacts, and IDE config from being pushed.
Glob Pattern Reference
| Pattern | Matches |
|---|---|
| *.log | All files ending in .log in any directory |
| /dist | dist/ folder only at the repo root |
| dist/ | Any directory named dist at any depth |
| !keep.log | Negation: un-ignore keep.log even if *.log is ignored |
| **/*.map | All .map files in any nested directory |
| config/*.env | All .env files inside config/ (not subdirs) |
Global .gitignore (IDE Files)
Create a global gitignore for IDE-specific files (like .DS_Store,.idea/,.vscode/) so you don't have to add them to every repo:
git config --global core.excludesfile ~/.gitignore_global