{"meta":{"title":"Points de terminaison d’API REST pour gitignore","intro":"Utilisez l’API REST pour obtenir des modèles .gitignore qui peuvent être utilisés pour ignorer les fichiers et les répertoires.","product":"API REST","breadcrumbs":[{"href":"/fr/enterprise-server@3.17/rest","title":"API REST"},{"href":"/fr/enterprise-server@3.17/rest/gitignore","title":"Gitignore"},{"href":"/fr/enterprise-server@3.17/rest/gitignore/gitignore","title":"Gitignore"}],"documentType":"article"},"body":"# Points de terminaison d’API REST pour gitignore\n\nUtilisez l’API REST pour obtenir des modèles .gitignore qui peuvent être utilisés pour ignorer les fichiers et les répertoires.\n\n## À propos de gitignore\n\nQuand vous créez un référentiel sur GitHub via l'API, vous pouvez spécifier un [modèle .gitignore](/fr/enterprise-server@3.17/get-started/git-basics/ignoring-files) à appliquer au référentiel lors de la création. Vous pouvez utiliser l’API REST pour obtenir les modèles .gitignore du [dépôt .gitignore](https://github.com/github/gitignore) GitHub.\n\n> \\[!NOTE]\n> Most endpoints use `Authorization: Bearer <YOUR-TOKEN>` and `Accept: application/vnd.github+json` headers, plus `X-GitHub-Api-Version: 2022-11-28`. Curl examples below omit these standard headers for brevity.\n\n## Get all gitignore templates\n\n```\nGET /gitignore/templates\n```\n\nList all templates available to pass as an option when creating a repository.\n\n### HTTP response status codes\n\n* **200** - OK\n\n* **304** - Not modified\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  http(s)://HOSTNAME/api/v3/gitignore/templates\n```\n\n**Response schema (Status: 200):**\n\nArray of string\n\n## Get a gitignore template\n\n```\nGET /gitignore/templates/{name}\n```\n\nGet the content of a gitignore template.\nThis endpoint supports the following custom media types. For more information, see \"Media types.\"\n\napplication/vnd.github.raw+json: Returns the raw .gitignore contents.\n\n### Parameters\n\n#### Headers\n\n* **`accept`** (string)\n  Setting to `application/vnd.github+json` is recommended.\n\n#### Path and query parameters\n\n* **`name`** (string) (required)\n\n### HTTP response status codes\n\n* **200** - OK\n\n* **304** - Not modified\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  http(s)://HOSTNAME/api/v3/gitignore/templates/NAME\n```\n\n**Response schema (Status: 200):**\n\n* `name`: required, string\n* `source`: required, string"}