.gitignore generator
Tick the languages, systems and editors your project uses and copy a ready .gitignore. Patterns repeated in several lists appear once. Add your own patterns at the end.
Runs in your browser: nothing you enter is sent anywhere.
How to use it
- Tick the stacks, systems and editors you use.
- Add your own patterns if needed.
- Copy the result into a .gitignore file at the root of the repository.
How it works
Each choice adds a short list of patterns under a comment heading, in a fixed order. A pattern already written by an earlier section is not repeated. Your own patterns come last.
Worked example
Ticking Node.js and JetBrains gives the Node section, then a JetBrains section with .idea/, *.iml and *.iws. With Java also ticked, build/ appears once, under the earlier section that has it.
Tips
- Editor and system files (.DS_Store, Thumbs.db, .idea/) can also go in a global ignore file, so they stay out of every repository.
- Start from a broad list and remove patterns that hide files you want to commit.
- Related files for a project: Dockerfile generator and robots.txt generator.
Frequently asked questions
How do I use the generated file?
Save the text as a file named .gitignore in the root of your repository and commit it. Git then skips the matching untracked files.
Why is a file still tracked after I ignored it?
Ignore rules only affect untracked files. Remove a tracked file from the index with git rm --cached <file>, then commit; the file stays on your disk.
What happens when several lists contain the same pattern?
It is written once, under the first list that contains it. A list that has nothing new left is left out.
Should lock files be ignored?
For applications, lock files are usually committed so everyone installs the same versions, and these lists do not ignore them. Libraries differ by ecosystem, so add a pattern if your project needs it.
Are .env files ignored?
The Node and Python lists ignore .env files, which often hold secrets. If a secret was ever committed, ignoring the file is not enough; it must be rotated.