Skip to content

Commit d668c7d

Browse files
committed
Gitignore API blog post
1 parent 1e8ab12 commit d668c7d

File tree

1 file changed

+58
-0
lines changed

1 file changed

+58
-0
lines changed
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
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/

0 commit comments

Comments
 (0)