# How to Contribute a New .gitignore Template to the GitHub gitignore Repository

> Contribute a new gitignore template to the GitHub gitignore repository. Learn how to fork, add your file, and open a pull request with clear documentation and rationale.

- Repository: [GitHub/gitignore](https://github.com/github/gitignore)
- Tags: how-to-guide
- Published: 2026-02-24

---

**To contribute a new .gitignore template to the GitHub gitignore repository, fork the repository, add a single template file to the appropriate directory (root, `Global/`, or `community/`), and open a pull request against `main` with documentation links and a clear rationale explaining why the template benefits the broader community.**

The **github/gitignore** repository powers the template chooser in the GitHub web interface. Contributing a new template requires following a strict workflow defined in [`CONTRIBUTING.md`](https://github.com/github/gitignore/blob/main/CONTRIBUTING.md) and [`README.md`](https://github.com/github/gitignore/blob/main/README.md) to ensure the collection remains curated, consistent, and maintainable at scale.

## Understanding the Repository Structure

The repository organizes templates into three distinct scopes. Choosing the correct location is the first step when you contribute a new `.gitignore` template.

- **Root directory** – Place templates here for common programming languages and mainstream frameworks (e.g., `Python.gitignore`, `Node.gitignore`).
- **`Global/`** – Use this for editor configurations, operating system files, and tool-specific settings that apply across projects (e.g., `Global/Vim.gitignore`, `Global/macOS.gitignore`).
- **`community/`** – Reserve this for specialized stacks, niche frameworks, or versioned templates that serve smaller segments of the developer community.

The repository's [`README.md`](https://github.com/github/gitignore/blob/main/README.md) details these folder structure rules in the *Folder structure* section.

## Contribution Requirements

Before opening a pull request, ensure your submission meets the repository's quality standards as defined in [`CONTRIBUTING.md`](https://github.com/github/gitignore/blob/main/CONTRIBUTING.md) (lines 25-28).

- **Single-template PRs** – Only one `.gitignore` file may be added or modified per pull request.
- **Documentation links** – Include a link to the technology's official homepage and supporting documentation so reviewers can verify the relevance of the ignore rules.
- **Community rationale** – Write a short paragraph explaining why the template is useful for everyone, not just your specific project.

## Step-by-Step Contribution Workflow

Follow the exact workflow outlined in the [`README.md`](https://github.com/github/gitignore/blob/main/README.md) *Contributing workflow* section (lines 37-44) to submit your template:

1. **Fork** the repository at `github/gitignore`.
2. **Create a branch** with a descriptive name (e.g., `add-rust-wasm-template`).
3. **Add the `.gitignore` file** to the proper directory based on the scope rules above.
4. **Commit** with a clear message, such as `Add MyFramework.gitignore`.
5. **Open a pull request** against the `main` branch.

## Handling Versioned Templates

If the technology maintains distinct version-specific ignore rules, follow the *Versioned templates* policy in [`README.md`](https://github.com/github/gitignore/blob/main/README.md) (lines 92-104).

- Place the "evergreen" or latest version at the repository root.
- Place older, version-specific templates under `community/` with the version number in the filename (e.g., `community/Django/2.2.gitignore`).

This structure prevents root directory bloat while preserving historical templates for legacy projects.

## Template Format and Best Practices

A high-quality template includes header comments with reference links and covers standard build artifacts, IDE files, and OS-specific metadata.

```gitignore

# MyFramework.gitignore

# Project homepage: https://myframework.org

# Documentation: https://myframework.org/docs/ignore-rules

# Build artefacts

/build/
/dist/

# IDE / editor files

*.idea/
*.vscode/

# OS‑specific files

.DS_Store
Thumbs.db

```

Place this file in the repository root if `MyFramework` is a mainstream language, or under `community/` if it is specialized or versioned.

## Writing an Effective Pull Request

Your pull request description must provide context for reviewers. Structure it to include the technology's homepage, documentation proving the ignore rules are correct, and a justification for community inclusion.

```markdown

# Add MyFramework.gitignore

This template provides a concise ignore list for MyFramework projects.
It covers typical build artefacts, IDE configuration files, and OS‑specific metadata.

- Homepage: https://myframework.org
- Documentation of generated files: https://myframework.org/docs/ignore-rules

Why this matters:
Developers using MyFramework frequently commit generated build folders, which clutter repos and leak large binaries. This template prevents that by default.

```

## Summary

- **Scope your template** correctly between root, `Global/`, and `community/` directories based on mainstream adoption.
- **Submit one template per PR** as required by [`CONTRIBUTING.md`](https://github.com/github/gitignore/blob/main/CONTRIBUTING.md) lines 25-28.
- **Include documentation links** to the technology homepage and official docs verifying the ignore rules.
- **Explain the rationale** for how the template benefits the broader developer community, not just your project.
- **Follow the fork-branch-commit-PR workflow** against `main` as specified in [`README.md`](https://github.com/github/gitignore/blob/main/README.md) lines 37-44.
- **Handle versioning** by placing evergreen templates in root and versioned variants in `community/` with versioned filenames.

## Frequently Asked Questions

### Can I submit multiple .gitignore templates in one pull request?

No. According to [`CONTRIBUTING.md`](https://github.com/github/gitignore/blob/main/CONTRIBUTING.md) lines 25-28, you must create a single-template PR. Each pull request may only modify or add one `.gitignore` file. This policy allows maintainers to review, discuss, and merge templates independently without blocking unrelated changes.

### Where should I place a template for a specific version of a framework?

Place the current "evergreen" version in the repository root. Place older, version-specific templates under the `community/` directory with the version number included in the filename (e.g., `community/Framework/1.0.gitignore`). This approach follows the *Versioned templates* section in [`README.md`](https://github.com/github/gitignore/blob/main/README.md) lines 92-104.

### What documentation links are required when contributing a template?

You must provide at minimum a link to the technology's official homepage and supporting documentation that verifies the files and directories listed in the template should indeed be ignored. These links allow maintainers to validate that the rules are accurate and officially sanctioned by the project.

### How do I know if my template belongs in the root directory or the community folder?

Root directory templates are reserved for widely adopted programming languages and major frameworks used across the industry. The `community/` folder is for specialized tools, niche frameworks, or versioned templates that serve specific segments. Consult the *Folder structure* section in [`README.md`](https://github.com/github/gitignore/blob/main/README.md) if uncertain; when in doubt, `community/` is the safer choice for emerging or specialized technologies.