File tree Expand file tree Collapse file tree 1 file changed +58
-0
lines changed
Expand file tree Collapse file tree 1 file changed +58
-0
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ kind: change
3+ title: Gitignore Templates API
4+ created_at: 2012-11-29
5+ author_name: pengwynn
6+ ---
7+
8+ We recently [made it easy][init-post] to initialize a repository when you create
9+ it [via the API][repo-create]. One of the options you can pass when creating a
10+ repository is `gitignore_template`. This value is the name of one of the
11+ templates from the the public [GitHub .gitignore repository][templates-repo].
12+
13+ The [Gitignore Templates API][new-api] makes it easy to list those templates:
14+
15+ curl https://api.github.com/gitignore/templates
16+
17+ HTTP/1.1 200 OK
18+
19+ [
20+ "Actionscript",
21+ "Android",
22+ "AppceleratorTitanium",
23+ "Autotools",
24+ "Bancha",
25+ "C",
26+ "C++",
27+ ...
28+
29+ If you'd like to view the source, you can also fetch a single template.
30+
31+ curl -H 'Accept: application/vnd.github.raw' \
32+ https://api.github.com/gitignore/templates/Objective-C
33+
34+ HTTP/1.1 200 OK
35+
36+ # Xcode
37+ .DS_Store
38+ build/
39+ *.pbxuser
40+ !default.pbxuser
41+ *.mode1v3
42+ !default.mode1v3
43+ *.mode2v3
44+ !default.mode2v3
45+ *.perspectivev3
46+ !default.perspectivev3
47+ *.xcworkspace
48+ !default.xcworkspace
49+ xcuserdata
50+ profile
51+ *.moved-aside
52+ DerivedData
53+ .idea/
54+
55+ [init-post]: /changes/2012-9-28-auto-init-for-repositories/
56+ [repo-create]: /v3/repos/#create
57+ [templates-repo]: https://github.com/github/gitignore
58+ [new-api]: /v3/gitignore/
You can’t perform that action at this time.
0 commit comments