Gitignore Generator

Generate .gitignore files for any project — select your languages, frameworks, IDEs, and OS for a comprehensive ignore list.

About .gitignore

A .gitignore file tells Git which files and directories to exclude from version control. Every project should have one — without it, you risk accidentally committing IDE configuration files, build artifacts, log files, local environment variables, dependency directories (node_modules, vendor), compiled binaries, and OS-generated files (.DS_Store on Mac, Thumbs.db on Windows).

Git pattern matching: * matches any file, **/ matches directories at any depth, ! negates a pattern (include previously ignored file), trailing / means directory only. Patterns in subdirectory .gitignore files only apply to that directory and below. The .gitignore file itself should be committed to the repository so all team members ignore the same files.

FAQ

What if I already committed files that should be ignored?
Adding a file to .gitignore does not remove it from tracking if already committed. Run: git rm --cached filename (or git rm -r --cached . to remove all tracked files), then commit. This removes them from tracking without deleting local files. Future commits will ignore them per your .gitignore rules.
Should I commit node_modules?
No. node_modules should always be in .gitignore. It can be hundreds of megabytes, is fully reproducible from package.json using npm install, and contains platform-specific binaries that may differ between developers. The same applies to vendor/ (PHP/Composer), venv/ (Python), and similar dependency directories.