# Get a gitignore template

From **GitHub v3 REST API**.

`GET /gitignore/templates/{name}`

The API also allows fetching the source of a single template.
Use the raw [media type](https://docs.github.com/enterprise-server@3.0/rest/overview/media-types/) to get the raw contents.

## Parameters

### `name`

- Location: path
- Required: true
- Type: `string`

## Responses

### `200`

Response

### `application/json`

- Type: `object`

Gitignore Template

```json
{
  "name": "C",
  "source": "# Object files\n*.o\n\n# Libraries\n*.lib\n*.a\n\n# Shared objects (inc. Windows DLLs)\n*.dll\n*.so\n*.so.*\n*.dylib\n\n# Executables\n*.exe\n*.out\n*.app\n"
}
```

```json
{"description":"Gitignore Template","properties":{"name":{"example":"C","type":"string"},"source":{"example":"# Object files\n*.o\n\n# Libraries\n*.lib\n*.a\n\n# Shared objects (inc. Windows DLLs)\n*.dll\n*.so\n*.so.*\n*.dylib\n\n# Executables\n*.exe\n*.out\n*.app\n","type":"string"}},"required":["name","source"],"title":"Gitignore Template","type":"object"}
```

### `304`

Not modified

## Request examples

### cURL

```shell
curl --request GET \
  --url {protocol}://{hostname}/api/v3/gitignore/templates/{name}
```
