Skip to content

Commit f99760a

Browse files
committed
Post for default branch
1 parent a4ade3c commit f99760a

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
kind: change
3+
title: Set the default branch for a repository
4+
created_at: 2012-10-24
5+
author_name: pengwynn
6+
---
7+
8+
You can set the default branch for a repository to something other than 'master' from the GitHub repository admin screen:
9+
10+
![repo admin](/images/posts/default-branch.png)
11+
12+
Now, you can update this setting via the API. We've added a `default_branch` parameter to the [Edit Repository method][edit-repo]:
13+
14+
<pre class="terminal">
15+
curl -u pengwynn \
16+
-d '{"name": "octokit", "default_branch":"development"}' \
17+
https://api.github.com/repos/pengwynn/octokit
18+
</pre>
19+
20+
If you provide a branch name that hasn't been pushed to GitHub, we'll gracefully fall back to `'master'` or the first branch.
21+
22+
[edit-repo]: /v3/repos/#edit
25.4 KB
Loading

0 commit comments

Comments
 (0)