.gitignore API

Tier: Free, Premium, Ultimate Offering: GitLab.com, Self-managed, GitLab Dedicated

GitLab에서 /gitignores 엔드포인트는 Git .gitignore 템플릿 목록을 반환합니다. 더 많은 정보는 .gitignore에 대한 Git 문서를 참조하세요.

모든 .gitignore 템플릿 가져오기

모든 .gitignore 템플릿 목록을 가져옵니다:

GET /templates/gitignores

예시 요청:

curl "https://gitlab.example.com/api/v4/templates/gitignores"

예시 응답:

[
  {
    "key": "Actionscript",
    "name": "Actionscript"
  },
  {
    "key": "Ada",
    "name": "Ada"
  },
  {
    "key": "Agda",
    "name": "Agda"
  },
  {
    "key": "Android",
    "name": "Android"
  },
  {
    "key": "AppEngine",
    "name": "AppEngine"
  },
  {
    "key": "AppceleratorTitanium",
    "name": "AppceleratorTitanium"
  },
  {
    "key": "ArchLinuxPackages",
    "name": "ArchLinuxPackages"
  },
  {
    "key": "Autotools",
    "name": "Autotools"
  },
  {
    "key": "C",
    "name": "C"
  },
  {
    "key": "C++",
    "name": "C++"
  },
  {
    "key": "CFWheels",
    "name": "CFWheels"
  },
  {
    "key": "CMake",
    "name": "CMake"
  },
  {
    "key": "CUDA",
    "name": "CUDA"
  },
  {
    "key": "CakePHP",
    "name": "CakePHP"
  },
  {
    "key": "ChefCookbook",
    "name": "ChefCookbook"
  },
  {
    "key": "Clojure",
    "name": "Clojure"
  },
  {
    "key": "CodeIgniter",
    "name": "CodeIgniter"
  },
  {
    "key": "CommonLisp",
    "name": "CommonLisp"
  },
  {
    "key": "Composer",
    "name": "Composer"
  },
  {
    "key": "Concrete5",
    "name": "Concrete5"
  }
]

단일 .gitignore 템플릿 가져오기

단일 .gitignore 템플릿을 가져옵니다:

GET /templates/gitignores/:key
속성 유형 필수 설명
key string yes .gitignore 템플릿의 키

예시 요청:

curl "https://gitlab.example.com/api/v4/templates/gitignores/Ruby"

예시 응답:

{
  "name": "Ruby",
  "content": "*.gem\n*.rbc\n/.config\n/coverage/\n/InstalledFiles\n/pkg/\n/spec/reports/\n/spec/examples.txt\n/test/tmp/\n/test/version_tmp/\n/tmp/\n\n# dotenv 라이브러리에서 환경 변수를 로드하는 데 사용함.\n# .env\n\n## RubyMotion에 특화됨:\n.dat*\n.repl_history\nbuild/\n*.bridgesupport\nbuild-iPhoneOS/\nbuild-iPhoneSimulator/\n\n## RubyMotion에 특화됨 (CocoaPods 사용):\n#\n# .gitignore에 Pods 디렉토리를 추가하지 않는 것을 권장합니다. 하지만\n# 장단점은 다음에서 언급되어 있습니다:\n# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control\n#\n# vendor/Pods/\n\n## 문서 캐시 및 생성된 파일:\n/.yardoc/\n/_yardoc/\n/doc/\n/rdoc/\n\n## 환경 정규화:\n/.bundle/\n/vendor/bundle\n/lib/bundler/man/\n\n# 라이브러리 또는 젬의 경우, 코드가 여러 환경에서 실행되도록 의도되었으므로\n# 이러한 파일들을 무시하는 것이 좋습니다. 그렇지 않으면 체크해야 합니다:\n# Gemfile.lock\n# .ruby-version\n# .ruby-gemset\n\n# rvm < 1.11.0을 지원하지 않거나 판타스틱한 작업을 하지 않는 한, 이것을 무시하세요:\n.rvmrc\n"
}