Git & DevOps
.gitignore Generator Online
Select your technologies and generate a clean, combined and maintainable .gitignore file.
Selected
.gitignore guide
What is a .gitignore file?
A .gitignore file tells Git which files and directories should not be considered untracked files for addition to a repository. It is useful for dependencies, caches, logs and local configuration.
.gitignore syntax
Patterns such as *.log, /vendor/, /build/ and !important.log ignore extensions, directories and exceptions using Git syntax.
Should I ignore .env?
.env files commonly contain secrets or local configuration and should not be committed. Keep a .env.example without real credentials as a template.
Already tracked files
.gitignore mainly affects untracked files. It does not automatically remove files Git is already tracking from the index.
Frequently asked questions
Questions about .gitignore
How do I create a .gitignore file?
Select the templates you need, review the result and download it with the name .gitignore.
What should go in .gitignore?
Include dependencies, temporary files, logs, caches and local configuration that should not be committed.
How do I ignore a folder?
Add a rule such as /backups/ or /vendor/ to ignore a directory from the repository root.
How do I ignore all .log files?
Use the pattern *.log.
How do I exclude a file from a rule?
Prefix the path with !, for example !important.log after *.log.
Why does Git still show an ignored file?
It may already be tracked. .gitignore does not automatically remove it from the index.
Should I ignore vendor?
Usually yes when dependencies are installed with Composer; keep composer.lock according to your workflow.
Should I ignore node_modules?
Usually yes in Node.js projects, although this tool only generates text and never runs Node.
Should I commit .env to Git?
Not when it contains secrets. Use a .env.example without real credentials.
Can I combine multiple templates?
Yes. Select multiple templates; exact duplicate rules are shown only once.