--- title: Set the default branch for a repository author_name: pengwynn --- You can set the default branch for a repository to something other than 'master' from the GitHub repository admin screen: ![repo admin](/assets/images/posts/default-branch.png) Now, you can update this setting via the API. We've added a `default_branch` parameter to the [Edit Repository method][edit-repo]: ``` command-line $ curl -u pengwynn \ $ -d '{"name": "octokit", "default_branch":"development"}' \ $ https://api.github.com/repos/octokit/octokit.rb ``` If you provide a branch name that hasn't been pushed to GitHub, we'll gracefully fall back to `'master'` or the first branch. [edit-repo]: /v3/repos/#edit