Skip to main content
The REST API is now versioned. For more information, see "About API versioning."

Gitignore

Use the REST API to get .gitignore templates that can be used to ignore files and directories.

About gitignore

When you create a new repository on GitHub.com via the API, you can specify a .gitignore template to apply to the repository upon creation. You can use the REST API to get .gitignore templates from the GitHub .gitignore repository.

You can use the application/vnd.github.raw custom media type when getting a gitignore template. For more information, see "Media types."

Get all gitignore templates

Works with GitHub Apps

List all templates available to pass as an option when creating a repository.

HTTP response status codes for "Get all gitignore templates"

Status codeDescription
200