登录 注册

gitignore (.gitignore 模板集合)

去点 Star
开发者工具 gitgitignore
176,390
Stars
82,022
Forks
3,363
Watchers
26
Open Issues
CC0-1.0
许可证
未知
语言
2010-11-08
创建时间
2026-11-09
最近更新

项目能做什么

GitHub 官方收集的实用 .gitignore 文件模板合集,覆盖多种语言与工具。
来源:基于仓库元数据 · 内容以仓库实际 README 为准

使用说明 查看原始 README 原仓库文档

项目简介

github/gitignore 是由 GitHub 官方维护的 .gitignore 模板合集。GitHub 网站在创建新仓库或新建文件时,界面中下拉可选的 .gitignore 模板正是来源于该项目。仓库旨在收集主流编程语言、开发工具和操作系统的忽略规则,防止不必要的文件被误提交到 Git 仓库中。

核心功能

  • 主流语言与技术模板:存放在仓库根目录下,涵盖常用编程语言和技术栈,开箱即用。
  • 全局环境模板(Global/ 目录):针对各类编辑器(Editor)、操作系统(OS)以及开发工具的模板,适用于跨项目或个人开发环境的通用忽略配置。
  • 社区拓展模板(community/ 目录):收录非主流技术、特定框架或工具的专用模板。
  • 版本化模板规范:根目录仅保留最新的长期支持版本(文件名不含版本号);历史旧版本则归档至 community/ 目录下(文件名包含具体版本号)。

适合谁用

  • 需要为个人或团队项目快速配置 .gitignore 的开发者。
  • 希望配置全局开发环境忽略文件(如编辑器配置、系统临时文件)的开发者。
  • 想要为特定语言、框架或工具贡献标准 .gitignore 规则的开源贡献者。

安装步骤

本项目仅为 .gitignore 规则模板的文本合集,不涉及安装步骤。README 原文未包含任何安装说明,请查看原仓库。

配置说明

你可以根据需求选择以下方式使用这些模板:

  1. 项目级配置: 从根目录或 community/ 目录中找到对应语言或框架的模板,复制其内容并重命名为 .gitignore,放置在你的项目根目录下。

示例:community/DotNet/InforCRM.gitignore ```gitignore # gitignore template for InforCRM (formerly SalesLogix) # website: https://www.infor.com/products/customer-experience-suite/crm # # Recommended: VisualStudio.gitignore

# Ignore model files that are auto-generated ModelIndex.xml ExportedFiles.xml

# Ignore deployment files [Mm]odel/[Dd]eployment

# Force include portal SupportFiles !Model/Portal//SupportFiles/[Bb]in/ !Model/Portal/PortalTemplates//SupportFiles/[Bb]in ```

  1. 全局环境配置: 针对 Global/ 目录下的操作系统或编辑器规则,建议将其添加到本地 Git 的全局忽略配置中,或者直接合并进具体项目的 .gitignore 文件中。

  2. 更多用法参考: 关于 Git 忽略规则的具体生效机制与详细配置语法,README 推荐参考: - 《Pro Git》书籍中的 Ignoring Files 章节 - GitHub 文档的 Ignoring Files 指南 - Git 官方手册页 gitignore(5)

常见问题

  • 为什么有些小众工具或框架没有被收录? 项目旨在维护最常用、最有价值的模板集合,无法涵盖世上存在的所有工具。未被收录并不代表该工具不优秀。
  • 如果需要贡献多版本的框架模板该怎么做? 根目录模板必须是当前支持的最新版本且文件名不带版本号;旧版本模板需放入 community/ 目录下并在文件名中明确标明版本。
  • 其他问题: README 原文未提供更多常见问题解答,如需了解贡献细节请查阅仓库内的 CONTRIBUTING.md,其他部分原文未说明,请查看原仓库。
原始 README 摘录(英文原文,节选前 3000 字符)
# 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`](./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](https://docs.github.com/en/get-started/getting-started-with-git/ignoring-files#configuring-ignored-files-for-all-repositories-on-your-computer)
  or merge these rules into your project-specific templates if you want to use
  them permanently.
- [`community`](./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](CONTRIBUTING.md).

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](#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](#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 c
阅读完整原文

商业机会分析 规则生成(AI 未配置)

综合评分 47.8 分。该项目在“个人可实施性”维度得 35 分,“付费可能性”维度得 20.0 分,差异化空间 46.0 分(评分依据见评分卡)。

面向细分需求的二次开发产品

产品构想基于 gitignore 的核心能力,聚焦一个更窄的场景(如某平台、某行业)做差异化。
目标用户该细分场景用户
难度/周期中 · 2~6 周
收费模式买断制 / 订阅制 / 广告
竞争风险细分需求规模需验证
依据 AI 推测:基于项目主题标签的判断
以上为规则引擎基于仓库公开数据生成的参考结论,包含推测成分,不构成投资或创业承诺;配置 AI 后可获得更深入的分析。
报告会保存到 个人中心

竞品与相似项目 GitHub Search 真实检索

项目中文简介Stars语言
ohmyzsh/ohmyzsh 中文介绍暂未生成
🙃 A delightful community-driven (with 2,500+ contributors)
190,569 Shell
521xueweihan/HelloGitHub 中文介绍暂未生成
:octocat: 分享 GitHub 上有趣、入门级的开源项目。Share interesting, entry-le
188,241 Python
anthropics/claude-code 中文介绍暂未生成
Claude Code is an agentic coding tool that lives in your ter
155,349 TypeScript
Chalarangelo/30-seconds-of-code 中文介绍暂未生成
Coding articles to level up your development skills
129,487 JavaScript
bregman-arie/devops-exercises 中文介绍暂未生成
Linux, Jenkins, AWS, SRE, Prometheus, Docker, Python, Ansibl
86,746 Python
jesseduffield/lazygit 中文介绍暂未生成
simple terminal UI for git commands
83,844 Go
以上为通过 GitHub 官方 Search API 检索的相似项目,功能差异与优劣势需进一步人工确认,配置 AI 后可生成对比分析。

项目优势与风险

技术成熟度创建于 2010-11-08,近 30 天仍在推送
社区活跃Star 176,390 / Fork 82,022 / Issue 26(数据支持,可自行核实)
许可证CC0-1.0
主要风险上游项目方向可能变化;同赛道竞争者较多(见竞品表);热度与需求不完全等价

安装与使用

快速开始(以仓库 README 为准)
git clone https://github.com/github/gitignore.git
cd gitignore
# 请阅读仓库 README 获取确切安装步骤(依赖、配置、启动命令)
阅读原仓库文档
术语说明:Docker=应用容器(把程序和依赖打包运行);API Key=调用外部服务的密钥;Git Clone=把仓库代码下载到本地。常见错误:API Key 未配置 / 端口占用 / 数据库连接失败,多数项目在 README 的 Troubleshooting 章节有说明。