.gitignore Generator
Choose languages, frameworks, editors and operating systems: you get a single .gitignore file, built from the official templates, ready to copy or download.
0 selected
Your .gitignore
Select at least one template to see the file.
Come utilizzare .gitignore Generator
Choose the templates
Start from a starting point or tick the languages, frameworks, editors and operating systems you use. It is a good idea to always include your operating system and your editor.
Review the composed file
The templates appear in catalog order, each with its own heading. Add your project-specific lines at the end.
Copy or download
Save the content as .gitignore in the root of the repository and commit.
Suggerimenti
- To find out why a file is ignored, use git check-ignore -v path: it tells you which line, in which file, excludes it.
- Git does not track empty folders: to keep one in the repository, put an empty file in it, conventionally named .gitkeep.
Domande frequenti
I already committed files I now want to ignore: is .gitignore enough?
No. .gitignore only applies to files that are not tracked yet. To stop tracking a file already in the repository, run git rm --cached filename (or git rm -r --cached folder) and commit. The file stays on disk.
Why does the order of the lines matter?
For each path, the last matching line wins. A negation such as !important.log re-includes a file only if it comes after the rule that ignored it. That is why the generator never touches negations and removes a repeated line only when there is no negation between the two occurrences.
Better a project .gitignore or a global one?
Project rules (build folders, dependencies) belong in the repository .gitignore, because they apply to the whole team. Your editor and operating system files can live in a personal global file, set with git config --global core.excludesFile. Here you can still include them in the project file.
Can I put files with passwords in .gitignore?
Yes, and it is standard practice for local .env files: add them to your own lines. But if a secret has already been committed, ignoring it is not enough: it stays in the history and must be considered compromised, so it must be regenerated.
Where do the templates come from?
From the github/gitignore repository, released under the CC0 1.0 license (public domain). The lines are copied unchanged and embedded in the page, which is why the tool works offline. Commit and date are shown at the bottom of the generated file.