title: Get the repository default branch of a GitHub repository
body: <p>I'm trying to use the GitHub API to get the default branch of a specified repository (<code>owner/repo</code>). </p>
  
  <p>I didn't find any docs regarding that. To get all branches I use:</p>
  
  <pre><code>curl https://api.github.com/repos/owner/owner/branches
  </code></pre>
  
  <p>This outputs the following json:</p>
  
  <pre><code>[
    {
      "name": "docs",
      "commit": {
        "sha": "a3...",
        "url": "https://api.github.com/repos/owner/repo/commits/a3..."
      }
    },
    {
      "name": "master",
      "commit": {
        "sha": "8c...",
        "url": "https://api.github.com/repos/owner/repo/commits/8c..."
      }
    }
  ]
  </code></pre>
  
  <p>This is already useful because in my case, the default branch is either <code>master</code> (if exists) or <code>gh-pages</code>. But I still want to know what's the correct way to get the default branch of a GitHub repository.</p>