github /gitignore

A collection of useful .gitignore templates

★ 176,290⑂ 82,015👁 3,362⑃ 4,815● 0▤ 0
CC0-1.0Created 2010-11-08
-44
Daily
+78
Weekly
176,290
stars
82,015
forks
3,362
watchers
4,815
prs
0
issues
0
releases

README

A collection of .gitignore templates

This is GitHub’s collection of [.gitignore][man] file templates.
We use this list to populate the .gitignore template choosers available
in the GitHub.com interface when creating new repositories and files.

For more information about how .gitignore files work, and how to use them,
the following resources are a great place to start:

- The [Ignoring Files chapter][chapter] of the [Pro Git][progit] book.
- The [Ignoring Files article][help] on the GitHub Help site.
- The [gitignore(5)][man] manual page.

[man]: https://git-scm.com/docs/gitignore
[help]: https://docs.github.com/en/get-started/git-basics/ignoring-files
[chapter]: https://git-scm.com/book/en/v2/Git-Basics-Recording-Changes-to-the-Repository_ignoring
[progit]: https://git-scm.com/book

 Folder structure

We support a collection of templates, organized in this way:

- The root folder contains templates in common use, to help people get started
  with popular programming languages and technologies. These define a meaningful
  set of rules to help get started, and ensure you are not committing
  unimportant files into your repository.
- Global contains templates for various editors, tools and
  operating systems that can be used in different situations. It is recommended
  that you either add these to your global template
  or merge these rules into your project-specific templates if you want to use
  them permanently.
- community contains specialized templates for other popular
  languages, tools, and projects that don't currently belong in the mainstream
  templates. These should be added to your project-specific templates when you
  decide to adopt the framework or tool.

 What makes a good template?

First and foremost, a template contribution must adhere to our
Contributing Guidelines.

A template should contain a set of rules to help Git repositories work with a
specific programming language, framework, tool or environment.

If it's not possible to curate a small set of useful rules for this situation,
then the template is not a good fit for this collection.

If a template is mostly a list of files installed by a particular version of
some software (e.g. a PHP framework), it could live under the community
directory. See versioned templates for more details.

If you have a small set of rules, or want to support a technology that is not
widely in use, and still believe this will be helpful to others, please read the
section about specialized templates for more details.

Include details when opening a pull request if the template is important and visible. We
may not accept it immediately, but we can promote it to the root at a later date
based on interest.

Please also understand that we can’t list every tool that ever existed.
Our aim is to curate a collection of the _most common and helpful_ templates,
not to make sure we cover every project possible. If we choose not to
include your language, tool, or project, it’s not because it’s not awesome.

Discussions

News & coverage (19)

Hacker NewsA Collection of Useful .gitignore Templates▲ 171 · 16 comments · 2010-11-20Hacker NewsInclusive Coding Bot on GitHub▲ 163 · 220 comments · 2022-04-01Hacker Newsgitignore – A collection of useful .gitignore templates▲ 21 · 4 comments · 2022-11-23Hacker NewsDefault .gitignore Files▲ 6 · 0 comments · 2010-11-08Hacker NewsShow HN: Simple gitignore generator on the web – GUItignore▲ 2 · 0 comments · 2025-06-21Crypto BriefingClaude Code leaks over 1,300 secrets into public GitHub repositories2026-11-09Ars TechnicaClaude Code is accidentally exposing secrets all over GitHub2026-11-09noteSecurity measures for AI agents: 3 things to prevent passwords from remaining after selecting 'Don't ask again'2026-11-09notePasswords remain in files when using 'Don't ask again' in Claude Code: The issue of public exposure on GitHub and the results of checking my own environment2026-11-08Martin Cid MagazineClaude Code’s ‘don’t ask again’ left passwords in 1,122 public GitHub files2026-11-08
9 morenote[AI Security] Claude Code's 'Don't ask again' is a pitfall for data leaks! Confidential information leaks discovered in 1,122 configuration files on GitHub!2026-11-08note[Since I was bored] Digging deeper into my self-made app again [Not a scam]2026-11-07The Hacker NewsClaude Code's “Don't Ask Again” File Exposes Passwords and Keys in 1,122 Public Copies on GitHub2026-11-06learnIgnore file changes with Git2025-02-17Candid Today PressHow to fix Gitignore not working issue?2021-03-14Towards Data ScienceAutomating the Setup of my Data Science Projects2025-02-04The GitHub BlogBeginner’s guide to GitHub repositories: How to create your first repo2024-06-24How-To GeekHow to Set Up .gitignore As a Whitelist2021-10-12Laravel NewsDebugging Git Ignore2019-06-14

Snapshot: 2026-11-16T09:23:14Z · Data license Apache-2.0 · JSON