---
title: "Get a gitignore template"
method: GET
path: "/gitignore/templates/{name}"
tags: ["gitignore"]
---

# Get a gitignore template

`GET /gitignore/templates/{name}`

Get the content of a gitignore template.

This endpoint supports the following custom media types. For more information, see "[Media types](https://docs.github.com/enterprise-cloud@latest/rest/using-the-rest-api/getting-started-with-the-rest-api#media-types)."

- **`application/vnd.github.raw+json`**: Returns the raw .gitignore contents.

## Path parameters

- `name` string, required

## Response `200`

Response

- GitignoreTemplate — Gitignore Template
  - `name` string, required
  - `source` string, required

## Other responses

- `304` — Not modified

---

[API](https://skmtc.net/github/apis/github-v3-rest-api-3.md) · [All operations](https://skmtc.net/github/apis/github-v3-rest-api-3/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/github/github-v3-rest-api-3/versions/dc0584ac4e13/schema)
