--- title: Gitignore Templates API author_name: pengwynn --- We recently [made it easy][init-post] to initialize a repository when you create it [via the API][repo-create]. One of the options you can pass when creating a repository is `gitignore_template`. This value is the name of one of the templates from the public [GitHub .gitignore repository][templates-repo]. The [Gitignore Templates API][new-api] makes it easy to list those templates: ``` command-line $ curl https://api.github.com/gitignore/templates > HTTP/1.1 200 OK > [ > "Actionscript", > "Android", > "AppceleratorTitanium", > "Autotools", > "Bancha", > "C", > "C++", > ... ``` If you'd like to view the source, you can also fetch a single template. ``` command-line $ curl -H 'Accept: application/vnd.github.raw' \ $ https://api.github.com/gitignore/templates/Objective-C > HTTP/1.1 200 OK # Xcode > .DS_Store > build/ > *.pbxuser > !default.pbxuser > *.mode1v3 > !default.mode1v3 > *.mode2v3 > !default.mode2v3 > *.perspectivev3 > !default.perspectivev3 > *.xcworkspace > !default.xcworkspace > xcuserdata > profile > *.moved-aside > DerivedData > .idea/ ``` [init-post]: /changes/2012-09-28-auto-init-for-repositories/ [repo-create]: /v3/repos/#create [templates-repo]: https://github.com/github/gitignore [new-api]: /v3/gitignore/