Gitignore Generator

Choose the languages, frameworks, editors and operating systems you use. The page merges their .gitignore templates into one file, labels every section and leaves out lines that repeat. Nothing you choose is sent anywhere.

Free Runs in your browser Checked Tuesday, November 10, 2026

This tool runs in your browser. What you enter is not sent to us.

How to use it

  1. Tick the languages, frameworks, editors and operating systems that your project uses. Use Clear all to start again.
  2. Read Your .gitignore file. Each template has its own label, and a line that another template already lists is shown only once.
  3. Click Copy or Download, and save the text as a file named .gitignore in the top folder of your project.

How the templates are merged

Each template you choose becomes one section, starting with a label line such as # ==== Node ====. The sections follow the order of the lists on the page, so the same choice always gives the same file.

  • A pattern that is already in the file is left out when it comes again.
  • A comment that is already in the file is left out in the same way.
  • Blank lines are kept between lines, and removed at the start and the end of each section.
  • A template whose lines are all listed by earlier templates adds nothing, so it gets no label line.

Repeated lines and the ! sign

Git reads the patterns of a .gitignore file in order, and a later pattern overrides an earlier one. A pattern that starts with ! includes again a file that an earlier pattern excluded (gitignore(5)). For that reason a repeated pattern is left out only when the lines between its two copies are of its own kind: if the pattern excludes, no line between the copies may start with !, and if it starts with !, no line between may exclude. Otherwise the repeat stays, because it changes the result.

Where the templates come from

The 51 templates are copies of files from github/gitignore, the collection of templates that GitHub offers for new repositories. The collection is released under CC0 1.0 Universal, which puts the templates in the public domain. The lines of each template are kept as they are, apart from the merge. Section labels use the names of the projects, which are not translated.

What the file does not cover

  • It does not know which files your own tools create. Add those lines yourself, for example a folder for uploads or a local settings file.
  • A pattern affects only files that git does not track yet. A file that is already tracked keeps being tracked until you run git rm --cached on it.
  • Editor and system files often belong in a global ignore file (core.excludesFile), so that every project on your computer ignores them without a line in the project file.

Worked example: C and C++

Choosing C and then C++ gives a file of 77 pattern and comment lines. The C section adds 46 lines. The C++ section adds 31 lines and leaves out 23 that the C section already lists, such as *.o, *.obj and *.so. Nothing comes between those copies that starts with !, so the repeats are left out.

Template Lines added Lines left out
C 46 0
C++ 31 23

Frequently asked questions

Is the .gitignore file sent to a server?

No. The templates are bundled with the page and the merge runs in your browser, so the file you build stays on your device until you save it.

Why is a line listed only once when two templates have it?

The merge keeps the first copy and leaves out the later copies, because a repeated pattern changes nothing. The exception is a repeat that comes after a line starting with !, which can change the result, so that copy stays.

Does a .gitignore file stop git from tracking a file that is already tracked?

No. A pattern only affects files that git does not track yet. To stop tracking a file that is already in the repository, run git rm --cached on it, and then the pattern applies to it.

Should editor and system files go in the project's .gitignore?

They can, but a global ignore file set with core.excludesFile is usually better. It applies to every project on your computer, so the project file keeps only the lines that matter to the project itself.

Are the templates up to date?

They are copies of the github/gitignore files as they were when this tool was last updated. The repository changes over time, so a newer version of a template may exist on GitHub.

Sources

Figures and text last checked on Tuesday, November 10, 2026.

We use necessary cookies to run the site. With your consent, Google also uses advertising cookies to show personalised ads. If you reject them, you still see ads, but they are not personalised.