Get a branch
/repos/{owner}/{repo}/branches/{branch}- Source
github-v3-rest.json- Revision
f5f067c1e6f6- Active snapshot
85e53e3d0d65
Request
Path Parameters
- owner stringrequired
- repo stringrequired
- branch stringrequired
The name of the branch.
Responses
Response
_links objectrequired
commit Commit objectrequiredCommit
Commit
author Simple User objectrequirednullable Simple User
Simple User
Example: https://github.com/images/error/octocat_happy.gif
Example: https://api.github.com/users/octocat/events{/privacy}
Example: https://api.github.com/users/octocat/followers
Example: https://api.github.com/users/octocat/following{/other_user}
Example: https://api.github.com/users/octocat/gists{/gist_id}
Example: 41d064eb2195891e12d0413f63227ea7
Example: https://github.com/octocat
Example: 1
Example: octocat
Example: MDQ6VXNlcjE=
Example: https://api.github.com/users/octocat/orgs
Example: https://api.github.com/users/octocat/received_events
Example: https://api.github.com/users/octocat/repos
Example: "2020-07-09T00:17:55Z"
Example: https://api.github.com/users/octocat/starred{/owner}{/repo}
Example: https://api.github.com/users/octocat/subscriptions
Example: User
Example: https://api.github.com/users/octocat
https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e/comments commit objectrequired
author Git User objectrequirednullable Metaproperties for Git author/committer information.
Metaproperties for Git author/committer information.
Example: "2007-10-29T02:42:39.000-07:00"
Example: "[email protected]"
Example: "Chris Wanstrath"
Example: 0
committer Git User objectrequirednullable Metaproperties for Git author/committer information.
Metaproperties for Git author/committer information.
Example: "2007-10-29T02:42:39.000-07:00"
Example: "[email protected]"
Example: "Chris Wanstrath"
Example: Fix all the bugs
tree objectrequired
Example: 827efc6d56897b048c772eb4087f854f46256132
Example: https://api.github.com/repos/octocat/Hello-World/tree/827efc6d56897b048c772eb4087f854f46256132
https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5e verification Verification objectoptional
committer Simple User objectrequirednullable Simple User
Simple User
Example: https://github.com/images/error/octocat_happy.gif
Example: https://api.github.com/users/octocat/events{/privacy}
Example: https://api.github.com/users/octocat/followers
Example: https://api.github.com/users/octocat/following{/other_user}
Example: https://api.github.com/users/octocat/gists{/gist_id}
Example: 41d064eb2195891e12d0413f63227ea7
Example: https://github.com/octocat
Example: 1
Example: octocat
Example: MDQ6VXNlcjE=
Example: https://api.github.com/users/octocat/orgs
Example: https://api.github.com/users/octocat/received_events
Example: https://api.github.com/users/octocat/repos
Example: "2020-07-09T00:17:55Z"
Example: https://api.github.com/users/octocat/starred{/owner}{/repo}
Example: https://api.github.com/users/octocat/subscriptions
Example: User
Example: https://api.github.com/users/octocat
files array[Diff Entry object]optional
items Diff Entry objectDiff Entry
Diff Entry
Example: 103
Example: https://github.com/octocat/Hello-World/blob/6dcb09b5b57875f334f61aebed695e2e4193db5e/file1.txt
Example: 124
https://api.github.com/repos/octocat/Hello-World/contents/file1.txt?ref=6dcb09b5b57875f334f61aebed695e2e4193db5eExample: 21
Example: file1.txt
Example: @@ -132,7 +132,7 @@ module Test @@ -1000,7 +1000,7 @@ module Test
Example: file.txt
Example: https://github.com/octocat/Hello-World/raw/6dcb09b5b57875f334f61aebed695e2e4193db5e/file1.txt
Example: bbcd538c8e72b8c175046e27cc8f907076331401
Example: added
Example: https://github.com/octocat/Hello-World/commit/6dcb09b5b57875f334f61aebed695e2e4193db5e
Example: MDY6Q29tbWl0NmRjYjA5YjViNTc4NzVmMzM0ZjYxYWViZWQ2OTVlMmU0MTkzZGI1ZQ==
parents array[object]required
items object
Example: https://github.com/octocat/Hello-World/commit/7638417db6d59f3c431d3e1f261cc637155684cd
Example: 7638417db6d59f3c431d3e1f261cc637155684cd
https://api.github.com/repos/octocat/Hello-World/commits/7638417db6d59f3c431d3e1f261cc637155684cdExample: 6dcb09b5b57875f334f61aebed695e2e4193db5e
stats objectoptional
https://api.github.com/repos/octocat/Hello-World/commits/6dcb09b5b57875f334f61aebed695e2e4193db5eExample: "mas*"
protection Branch Protection objectrequiredBranch Protection
Branch Protection
allow_deletions objectoptional
allow_force_pushes objectoptional
enforce_admins Protected Branch Admin Enforced objectoptionalProtected Branch Admin Enforced
Protected Branch Admin Enforced
Example: true
Example: https://api.github.com/repos/octocat/Hello-World/branches/master/protection/enforce_admins
Example: "branch/with/protection"
"https://api.github.com/repos/owner-79e94e2d36b3fd06a32bb213/AAA_Public_Repo/branches/branch/with/protection/protection" required_conversation_resolution objectoptional
required_linear_history objectoptional
required_pull_request_reviews Protected Branch Pull Request Review objectoptionalProtected Branch Pull Request Review
Protected Branch Pull Request Review
Example: true
dismissal_restrictions objectoptional
The list of teams with review dismissal access.
"https://api.github.com/repos/the-org/an-org-repo/branches/master/protection/dismissal_restrictions/teams""https://api.github.com/repos/the-org/an-org-repo/branches/master/protection/dismissal_restrictions"The list of users with review dismissal access.
"https://api.github.com/repos/the-org/an-org-repo/branches/master/protection/dismissal_restrictions/users"Example: true
Example: 2
https://api.github.com/repos/octocat/Hello-World/branches/master/protection/dismissal_restrictions required_signatures objectoptional
Example: true
Example: https://api.github.com/repos/octocat/Hello-World/branches/master/protection/required_signatures
required_status_checks Protected Branch Required Status Check objectoptionalProtected Branch Required Status Check
Protected Branch Required Status Check
restrictions Branch Restriction Policy objectoptionalBranch Restriction Policy
Branch Restriction Policy
Example: 1
Moved permanently
Resource not found
Preview header missing