Skip to main content
GET
/
repos
/
{owner}
/
{repo}
/
branches
/
{branch}
Get a branch
curl --request GET \
  --url https://gogs.example.com/api/v1/repos/{owner}/{repo}/branches/{branch} \
  --header 'Authorization: <api-key>'
{
  "name": "<string>",
  "commit": {
    "id": "<string>",
    "message": "<string>",
    "url": "<string>",
    "author": {
      "name": "<string>",
      "email": "<string>",
      "username": "<string>"
    },
    "committer": {
      "name": "<string>",
      "email": "<string>",
      "username": "<string>"
    },
    "timestamp": "2023-11-07T05:31:56Z"
  }
}

Authorizations

Authorization
string
header
required

Personal access token. Use format: token {YOUR_ACCESS_TOKEN}

Path Parameters

owner
string
required

Repository owner

repo
string
required

Repository name

branch
string
required

Branch name

Response

Success

name
string
commit
object