debian-mirror-gitlab/doc/api/templates/gitignores.md

126 lines
2.8 KiB
Markdown
Raw Normal View History

2017-09-10 17:25:29 +05:30
# Gitignores API
2016-11-03 12:29:30 +05:30
## List gitignore templates
Get all gitignore templates.
```
GET /templates/gitignores
```
```bash
2017-08-17 22:00:37 +05:30
curl https://gitlab.example.com/api/v4/templates/gitignores
2016-11-03 12:29:30 +05:30
```
Example response:
```json
[
{
2018-12-05 23:21:45 +05:30
"key": "Actionscript",
"name": "Actionscript"
2016-11-03 12:29:30 +05:30
},
{
2018-12-05 23:21:45 +05:30
"key": "Ada",
2016-11-03 12:29:30 +05:30
"name": "Ada"
},
{
2018-12-05 23:21:45 +05:30
"key": "Agda",
"name": "Agda"
2016-11-03 12:29:30 +05:30
},
{
2018-12-05 23:21:45 +05:30
"key": "Android",
2016-11-03 12:29:30 +05:30
"name": "Android"
},
{
2018-12-05 23:21:45 +05:30
"key": "AppEngine",
"name": "AppEngine"
2016-11-03 12:29:30 +05:30
},
{
2018-12-05 23:21:45 +05:30
"key": "AppceleratorTitanium",
"name": "AppceleratorTitanium"
2016-11-03 12:29:30 +05:30
},
{
2018-12-05 23:21:45 +05:30
"key": "ArchLinuxPackages",
2016-11-03 12:29:30 +05:30
"name": "ArchLinuxPackages"
},
{
2018-12-05 23:21:45 +05:30
"key": "Autotools",
2016-11-03 12:29:30 +05:30
"name": "Autotools"
},
{
2018-12-05 23:21:45 +05:30
"key": "C",
"name": "C"
2016-11-03 12:29:30 +05:30
},
{
2018-12-05 23:21:45 +05:30
"key": "C++",
"name": "C++"
2016-11-03 12:29:30 +05:30
},
{
2018-12-05 23:21:45 +05:30
"key": "CFWheels",
2016-11-03 12:29:30 +05:30
"name": "CFWheels"
},
{
2018-12-05 23:21:45 +05:30
"key": "CMake",
2016-11-03 12:29:30 +05:30
"name": "CMake"
},
{
2018-12-05 23:21:45 +05:30
"key": "CUDA",
"name": "CUDA"
2016-11-03 12:29:30 +05:30
},
{
2018-12-05 23:21:45 +05:30
"key": "CakePHP",
"name": "CakePHP"
2016-11-03 12:29:30 +05:30
},
{
2018-12-05 23:21:45 +05:30
"key": "ChefCookbook",
"name": "ChefCookbook"
2016-11-03 12:29:30 +05:30
},
{
2018-12-05 23:21:45 +05:30
"key": "Clojure",
2016-11-03 12:29:30 +05:30
"name": "Clojure"
},
{
2018-12-05 23:21:45 +05:30
"key": "CodeIgniter",
"name": "CodeIgniter"
2016-11-03 12:29:30 +05:30
},
{
2018-12-05 23:21:45 +05:30
"key": "CommonLisp",
"name": "CommonLisp"
2016-11-03 12:29:30 +05:30
},
{
2018-12-05 23:21:45 +05:30
"key": "Composer",
"name": "Composer"
2016-11-03 12:29:30 +05:30
},
{
2018-12-05 23:21:45 +05:30
"key": "Concrete5",
"name": "Concrete5"
2016-11-03 12:29:30 +05:30
}
]
```
## Single gitignore template
Get a single gitignore template.
```
GET /templates/gitignores/:key
```
| Attribute | Type | Required | Description |
| ---------- | ------ | -------- | ----------- |
| `key` | string | yes | The key of the gitignore template |
```bash
2017-08-17 22:00:37 +05:30
curl https://gitlab.example.com/api/v4/templates/gitignores/Ruby
2016-11-03 12:29:30 +05:30
```
Example response:
```json
{
"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# Used by dotenv library to load environment variables.\n# .env\n\n## Specific to RubyMotion:\n.dat*\n.repl_history\nbuild/\n*.bridgesupport\nbuild-iPhoneOS/\nbuild-iPhoneSimulator/\n\n## Specific to RubyMotion (use of CocoaPods):\n#\n# We recommend against adding the Pods directory to your .gitignore. However\n# you should judge for yourself, the pros and cons are mentioned at:\n# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control\n#\n# vendor/Pods/\n\n## Documentation cache and generated files:\n/.yardoc/\n/_yardoc/\n/doc/\n/rdoc/\n\n## Environment normalization:\n/.bundle/\n/vendor/bundle\n/lib/bundler/man/\n\n# for a library or gem, you might want to ignore these files since the code is\n# intended to run in multiple environments; otherwise, check them in:\n# Gemfile.lock\n# .ruby-version\n# .ruby-gemset\n\n# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:\n.rvmrc\n"
}
```