.gitignore generator
Combine GitHub’s official .gitignore templates for your language, your editor and your operating system into one clean file.
Common picks
In your .gitignore
Nothing yet. Pick a language, an editor and your operating system.
Templates come unchanged from github/gitignore
How to use it
- Search for what your project uses, or tap a common pick: a language such as
Node, an editor such asVisualStudioCode, and your OS such asmacOS. - The templates are merged in the order you picked them, each under its own heading, with repeated lines removed.
- Download the file, put it in the root of your repository, and commit it before your first
git add.
Where the templates come from
Every template is read, unchanged, from github/gitignore, the collection GitHub itself offers when you create a repository. It covers 300 or so languages, frameworks, editors and tools, including the editor and operating system files under Global/ that the GitHub repository picker leaves out.
Files are fetched straight from GitHub when you pick them, so you always get the current version.
Project .gitignore or global .gitignore?
Rules for what your project produces (node_modules/, __pycache__/, build/, .env) belong in the repository’s .gitignore, so everyone who clones it gets them.
Rules for your own machine (.DS_Store from macOS, Thumbs.db from Windows, editor folders) can also live in a personal global file. Save the editor and OS templates as ~/.gitignore_global and run git config --global core.excludesFile ~/.gitignore_global.
When a file is already tracked
A .gitignore only stops untracked files from being added. If a file was committed before, Git keeps tracking it. Remove it from the index, not from disk, with git rm --cached <file> (add -r for a folder), then commit.
Related tools
Questions people ask
How do I create a .gitignore file?
Pick your templates above, download the result and save it as .gitignore in the root of your repository. On macOS and Linux, files starting with a dot are hidden; use ls -a to see it.
Why is my .gitignore not working?
Usually the file was tracked before the rule existed. Run git rm --cached on it and commit. Also check the file is named exactly .gitignore with no .txt extension.
Should .env be in .gitignore?
Yes. Environment files hold secrets. Most language templates already list .env; commit a .env.example with dummy values instead.
Can I have more than one .gitignore?
Yes. Any folder can have its own, and its rules apply to that folder and below.
Does this use my GitHub API allowance?
No. Templates are read as plain files from GitHub, which does not count against the API limit.