Branches

38 commands (DELETE 10, GET 12, PATCH 2, POST 9, PUT 5). Write commands (POST, PUT, PATCH, DELETE) change data on GitHub, use -WhatIf to preview a request

Command Alias Method Endpoint Synopsis
Get-GitHubRepositoryAccessRestrictions Get-GHRepositoryAccessRestrictions GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions Get access restrictions
Get-GitHubRepositoryAdminBranchProtection Get-GHRepositoryAdminBranchProtection GET /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins Get admin branch protection
Get-GitHubRepositoryAllStatusCheckContexts Get-GHRepositoryAllStatusCheckContexts GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts Get all status check contexts
Get-GitHubRepositoryAppsWithAccessToProtectedBranch Get-GHRepositoryAppsWithAccessToProtectedBranch GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps Get apps with access to the protected branch
Get-GitHubRepositoryBranch Get-GHRepositoryBranch GET /repos/{owner}/{repo}/branches/{branch} Get a branch
Get-GitHubRepositoryBranchProtection Get-GHRepositoryBranchProtection GET /repos/{owner}/{repo}/branches/{branch}/protection Get branch protection
Get-GitHubRepositoryBranches Get-GHRepositoryBranches GET /repos/{owner}/{repo}/branches List branches
Get-GitHubRepositoryCommitSignatureProtection Get-GHRepositoryCommitSignatureProtection GET /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures Get commit signature protection
Get-GitHubRepositoryPullRequestReviewProtection Get-GHRepositoryPullRequestReviewProtection GET /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews Get pull request review protection
Get-GitHubRepositoryStatusChecksProtection Get-GHRepositoryStatusChecksProtection GET /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks Get status checks protection
Get-GitHubRepositoryTeamsWithAccessToProtectedBranch Get-GHRepositoryTeamsWithAccessToProtectedBranch GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams Get teams with access to the protected branch
Get-GitHubRepositoryUsersWithAccessToProtectedBranch Get-GHRepositoryUsersWithAccessToProtectedBranch GET /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users Get users with access to the protected branch
New-GitHubRepositoryAddAppAccessRestrictions Get-GHNewRepositoryAddAppAccessRestrictions POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps Add app access restrictions
New-GitHubRepositoryAddStatusCheckContexts Get-GHNewRepositoryAddStatusCheckContexts POST /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts Add status check contexts
New-GitHubRepositoryAddTeamAccessRestrictions Get-GHNewRepositoryAddTeamAccessRestrictions POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams Add team access restrictions
New-GitHubRepositoryAddUserAccessRestrictions Get-GHNewRepositoryAddUserAccessRestrictions POST /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users Add user access restrictions
New-GitHubRepositoryCommitSignatureProtection Get-GHNewRepositoryCommitSignatureProtection POST /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures Create commit signature protection
New-GitHubRepositoryMerge Get-GHNewRepositoryMerge POST /repos/{owner}/{repo}/merges Merge a branch
New-GitHubRepositoryMergeUpstream Get-GHNewRepositoryMergeUpstream POST /repos/{owner}/{repo}/merge-upstream Sync a fork branch with the upstream repository
New-GitHubRepositoryRenameBranch Get-GHNewRepositoryRenameBranch POST /repos/{owner}/{repo}/branches/{branch}/rename Rename a branch
New-GitHubRepositorySetAdminBranchProtection Get-GHNewRepositorySetAdminBranchProtection POST /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins Set admin branch protection
Remove-GitHubRepositoryAccessRestrictions Get-GHRemoveRepositoryAccessRestrictions DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions Delete access restrictions
Remove-GitHubRepositoryAdminBranchProtection Get-GHRemoveRepositoryAdminBranchProtection DELETE /repos/{owner}/{repo}/branches/{branch}/protection/enforce_admins Delete admin branch protection
Remove-GitHubRepositoryAppAccessRestrictions Get-GHRemoveRepositoryAppAccessRestrictions DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps Remove app access restrictions
Remove-GitHubRepositoryBranchProtection Get-GHRemoveRepositoryBranchProtection DELETE /repos/{owner}/{repo}/branches/{branch}/protection Delete branch protection
Remove-GitHubRepositoryCommitSignatureProtection Get-GHRemoveRepositoryCommitSignatureProtection DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_signatures Delete commit signature protection
Remove-GitHubRepositoryPullRequestReviewProtection Get-GHRemoveRepositoryPullRequestReviewProtection DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews Delete pull request review protection
Remove-GitHubRepositoryStatusCheckContexts Get-GHRemoveRepositoryStatusCheckContexts DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts Remove status check contexts
Remove-GitHubRepositoryStatusCheckProtection Get-GHRemoveRepositoryStatusCheckProtection DELETE /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks Remove status check protection
Remove-GitHubRepositoryTeamAccessRestrictions Get-GHRemoveRepositoryTeamAccessRestrictions DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams Remove team access restrictions
Remove-GitHubRepositoryUserAccessRestrictions Get-GHRemoveRepositoryUserAccessRestrictions DELETE /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users Remove user access restrictions
Set-GitHubRepositoryAppAccessRestrictions Get-GHSetRepositoryAppAccessRestrictions PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/apps Set app access restrictions
Set-GitHubRepositoryBranchProtection Get-GHSetRepositoryBranchProtection PUT /repos/{owner}/{repo}/branches/{branch}/protection Update branch protection
Set-GitHubRepositoryPullRequestReviewProtection Get-GHSetRepositoryPullRequestReviewProtection PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_pull_request_reviews Update pull request review protection
Set-GitHubRepositoryStatusCheckContexts Get-GHSetRepositoryStatusCheckContexts PUT /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks/contexts Set status check contexts
Set-GitHubRepositoryStatusCheckProtection Get-GHSetRepositoryStatusCheckProtection PATCH /repos/{owner}/{repo}/branches/{branch}/protection/required_status_checks Update status check protection
Set-GitHubRepositoryTeamAccessRestrictions Get-GHSetRepositoryTeamAccessRestrictions PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/teams Set team access restrictions
Set-GitHubRepositoryUserAccessRestrictions Get-GHSetRepositoryUserAccessRestrictions PUT /repos/{owner}/{repo}/branches/{branch}/protection/restrictions/users Set user access restrictions

Have a look around and if you would like to contribute please read over the Contributing guide


Table of contents