Skip to main content

이 버전의 GitHub Enterprise Server는 다음 날짜에 중단됩니다. 2026-09-22. 지원되지 않는 릴리스는 지원되지 않습니다. 중요한 보안 문제에 대해서도 패치 릴리스가 이루어지지 않습니다. GitHub Enterprise Server의 향상된 성능, 향상된 보안 및 새로운 기능은 업그레이드 프로세스의 오버뷰 참조하세요. 업그레이드에 대한 도움이 필요하면 GitHub Enterprise 지원에 문의하세요.

이제 REST API의 버전이 지정되었습니다. 자세한 내용은 "API 버전 관리 정보"를 참조하세요.

gitignore에 대한 REST API 엔드포인트

REST API를 사용하고 파일 및 디렉터리를 무시하는 데 사용할 수 있는 .gitignore 템플릿을 가져옵니다.

gitignore에 대한 정보

API를 통해 GitHub에서 새 리포지토리를 만들 때 생성 시 리포지토리에 적용할 .gitignore 템플릿을 지정할 수 있습니다. REST API를 사용하여 GitHub .gitignore 리포지토리에서 .gitignore 템플릿을 받을 수 있습니다.

Get all gitignore templates

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

"Get all gitignore templates"에 대한 세분화된 액세스 토큰

이 엔드포인트는 다음 세분화된 토큰 형식에서 작동합니다.:

세분화된 토큰에는 어떤 권한도 필요하지 않습니다.

공용 리소스만 요청되는 경우 인증 없이 이 엔드포인트를 사용할 수 있습니다.

"Get all gitignore templates"에 대한 HTTP 응답 상태 코드

상태 코드설명
200

OK

304

Not modified

"Get all gitignore templates"에 대한 코드 샘플

요청 예제

get/gitignore/templates
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ http(s)://HOSTNAME/api/v3/gitignore/templates

Response

Status: 200
[ "Actionscript", "Android", "AppceleratorTitanium", "Autotools", "Bancha", "C", "C++" ]

Get a gitignore template

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.

"Get a gitignore template"에 대한 세분화된 액세스 토큰

이 엔드포인트는 다음 세분화된 토큰 형식에서 작동합니다.:

세분화된 토큰에는 어떤 권한도 필요하지 않습니다.

공용 리소스만 요청되는 경우 인증 없이 이 엔드포인트를 사용할 수 있습니다.

"Get a gitignore template"에 대한 매개 변수

머리글
이름, 유형, 설명
accept string

Setting to application/vnd.github+json is recommended.

경로 매개 변수
이름, 유형, 설명
name string 필수

"Get a gitignore template"에 대한 HTTP 응답 상태 코드

상태 코드설명
200

OK

304

Not modified

"Get a gitignore template"에 대한 코드 샘플

요청 예제

get/gitignore/templates/{name}
curl -L \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ -H "X-GitHub-Api-Version: 2022-11-28" \ http(s)://HOSTNAME/api/v3/gitignore/templates/NAME

Response

Status: 200
{ "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" }