GitHub Enterprise Gitignore API

View gitignore templates

Operations 2

GET /gitignore/templates Get all gitignore templates #
GET /gitignore/templates/{name} Get a gitignore template #

Documentation

Specifications

Schemas & Data

Other Resources

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/github-enterprise:github-enterprise-gitignore-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

github-enterprise-gitignore-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Github Enterprise Gitignore API
  version: 1.1.4
  contact:
    name: Support
    url: https://support.github.com/contact?tags=dotcom-rest-api
  license:
    name: MIT
    url: https://spdx.org/licenses/MIT
  termsOfService: https://docs.github.com/articles/github-terms-of-service
  x-github-plan: ghec
  description: 'Operations tagged gitignore across 2 of this provider''s published API definitions: github-enterprise-ghec-openapi.json, github-enterprise-openapi.yml. Each path carries the servers of the definition it was published in.'
servers:
- url: https://api.github.com
tags:
- name: gitignore
  description: View gitignore templates
paths:
  /gitignore/templates:
    get:
      summary: Get all gitignore templates
      description: List all templates available to pass as an option when creating a repository.
      operationId: gitignore/get-all-templates
      tags:
      - gitignore
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-cloud@latest/rest/gitignore/gitignore#get-all-gitignore-templates
      parameters: []
      responses:
        '200':
          description: Response
          content:
            application/json:
              schema:
                type: array
                items:
                  type: string
              examples:
                default:
                  value:
                  - Actionscript
                  - Android
                  - AppceleratorTitanium
                  - Autotools
                  - Bancha
                  - C
                  - C++
        '304':
          $ref: '#/components/responses/not_modified'
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: true
        category: gitignore
        subcategory: gitignore
    servers:
    - url: https://api.github.com
  /gitignore/templates/{name}:
    get:
      summary: Get a gitignore template
      description: 'Get the content of a gitignore template.


        This endpoint supports the following custom media types. For more information, see "Media types."


        - **`application/vnd.github.raw+json`**: Returns the raw .gitignore contents.'
      operationId: gitignore/get-template
      tags:
      - gitignore
      externalDocs:
        description: API method documentation
        url: https://docs.github.com/enterprise-cloud@latest/rest/gitignore/gitignore#get-a-gitignore-template
      parameters:
      - name: name
        in: path
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/gitignore-template'
              examples:
                default:
                  $ref: '#/components/examples/gitignore-template'
        '304':
          $ref: '#/components/responses/not_modified'
      x-github:
        githubCloudOnly: false
        enabledForGitHubApps: true
        category: gitignore
        subcategory: gitignore
    servers:
    - url: https://api.github.com
components:
  schemas:
    gitignore-template:
      title: Gitignore Template
      description: Gitignore Template
      type: object
      properties:
        name:
          type: string
          example: C
        source:
          type: string
          example: '# Object files

            *.o


            # Libraries

            *.lib

            *.a


            # Shared objects (inc. Windows DLLs)

            *.dll

            *.so

            *.so.*

            *.dylib


            # Executables

            *.exe

            *.out

            *.app

            '
      required:
      - name
      - source
  responses:
    not_modified:
      description: Not modified
  examples:
    gitignore-template:
      value:
        name: C
        source: '# Object files

          *.o


          # Libraries

          *.lib

          *.a


          # Shared objects (inc. Windows DLLs)

          *.dll

          *.so

          *.so.*

          *.dylib


          # Executables

          *.exe

          *.out

          *.app

          '
externalDocs:
  description: GitHub Enterprise Cloud REST API
  url: https://docs.github.com/enterprise-cloud@latest/rest/
x-refined-from:
- github-enterprise-ghec-openapi.json
- github-enterprise-openapi.yml