Skip to content

Instantly share code, notes, and snippets.

@sapk
Last active February 8, 2016 08:18
Show Gist options
  • Save sapk/df64347ff218baf4a277 to your computer and use it in GitHub Desktop.
Save sapk/df64347ff218baf4a277 to your computer and use it in GitHub Desktop.

Repositories Branches

List branches

GET /repos/:username/:reponame/branches
Response
Status: 200 OK
Content-Type: application/json
[
   {
      "name":"master",
      "commit":{
         "id":"c1c220c4dd6df895965a02b8be575c5e2f78dfd1",
         "message":"A commit message. \n",
         "url":"Not implemented",
         "author":{
            "name":"Author Name",
            "email":"author@email.com",
            "username":""
         }
      }
   },
   {
      "name":"second-branch",
      "commit":{
         "id":"0a0fdf63c23af6a2836c426c5284136015ec2996",
         "message":"A second commit message.\n",
         "url":"Not implemented",
         "author":{
            "name":"Author Name",
            "email":"author@email.com",
            "username":""
         }
      }
   }
]

Get a branch

GET /repos/:username/:reponame/branches/:branchname

Response

Status: 200 OK
Content-Type: application/json
{
   "name":":branchname",
   "commit":{
      "id":"0a0fdf63c23af6a2836c426c5284136015ec2996",
      "message":"A second commit message.\n",
      "url":"Not implemented",
      "author":{
         "name":"Author Name",
         "email":"author@email.com",
         "username":""
      }
   }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment