Skip to content

Commit 316b1e6

Browse files
committed
Post on auto init'ing
1 parent b5db502 commit 316b1e6

File tree

3 files changed

+52
-1
lines changed

3 files changed

+52
-1
lines changed
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
---
2+
kind: change
3+
title: Initialize a repository when creating
4+
created_at: 2012-9-28
5+
author_name: pengwynn
6+
---
7+
8+
Today we've made it easier to add commits to a repository via the GitHub API.
9+
Until now, you could [create a repository](/v3/repos/#create), but you would
10+
need to initialize it locally via your Git client before adding any commits via
11+
the API.
12+
13+
Now you can optionally init a repository when it's created by sending `true`
14+
for the `auto_init` parameter:
15+
16+
<pre class="terminal">
17+
curl -i -u pengwynn \
18+
-d '{"name": "create-repo-test", "auto_init": true}' \
19+
https://api.github.com/user/repos
20+
</pre>
21+
22+
The resulting repository will have a README stub and an initial commit.
23+
24+
![create repo screenshot](/images/posts/create-repo-init.png)
25+
26+
### .gitignore templates
27+
28+
Along with this change, you can set up your `.gitignore` template by passing
29+
the basename of any template in the [GitHub gitignore templates
30+
project](https://github.com/github/gitignore).
31+
32+
<pre class="terminal">
33+
curl -i -u pengwynn \
34+
-d '{"name": "create-repo-test", "auto_init": true, \
35+
"gitignore_template": "Haskell"}' \
36+
https://api.github.com/user/repos
37+
</pre>
38+
39+
40+
As the [docs point out](/v3/repos/#create), the `gitignore_template` parameter
41+
is ignored if `auto_init` is not present and `true`.
42+
43+
If you have any questions or feedback, drop us a line at
44+
[https://github.com/contact][c], [support@github.com][email], or
45+
[@GitHubAPI][twitter].
46+
47+
[twitter]: https://twitter.com/githubapi
48+
[email]: mailto:support@github.com
49+
[c]: https://github.com/c
50+

lib/resources.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ module Helpers
2222
}
2323

2424
AUTHORS = {
25-
:technoweenie => '821395fe70906c8290df7f18ac4ac6cf'
25+
:technoweenie => '821395fe70906c8290df7f18ac4ac6cf',
26+
:pengwynn => '7e19cd5486b5d6dc1ef90e671ba52ae0'
2627
}
2728

2829
DefaultTimeFormat = "%B %-d, %Y".freeze
45.4 KB
Loading

0 commit comments

Comments
 (0)