Skip to content

Latest commit

 

History

History
62 lines (43 loc) · 1.1 KB

File metadata and controls

62 lines (43 loc) · 1.1 KB
title Gitignore | GitHub API

Gitignore

  • TOC {:toc}

When you create a new GitHub repository via the API, you can specify a .gitignore template to apply to the repository upon creation. The .gitignore Templates API lists and fetches templates from the GitHub .gitignore repository.

Listing available templates

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

GET /gitignore/templates

Response

<%= headers 200 %> <%= json(:templates) %>

Get a single template

The API also allows fetching the source of a single template.

GET /gitignore/templates/C

Response

<%= headers 200 %> <%= json(:template) %>

Use the raw media type to get the raw contents.

<%= headers 200 %>

# Object files
*.o

# Libraries
*.lib
*.a

# Shared objects (inc. Windows DLLs)
*.dll
*.so
*.so.*
*.dylib

# Executables
*.exe
*.out
*.app