CodeCommit.Client.delete_branch(**kwargs)¶Deletes a branch from a repository, unless that branch is the default branch for the repository.
See also: AWS API Documentation
Request Syntax
response = client.delete_branch(
repositoryName='string',
branchName='string'
)
[REQUIRED]
The name of the repository that contains the branch to be deleted.
[REQUIRED]
The name of the branch to delete.
dict
Response Syntax
{
'deletedBranch': {
'branchName': 'string',
'commitId': 'string'
}
}
Response Structure
(dict) --
Represents the output of a delete branch operation.
deletedBranch (dict) --
Information about the branch deleted by the operation, including the branch name and the commit ID that was the tip of the branch.
branchName (string) --
The name of the branch.
commitId (string) --
The ID of the last commit made to the branch.
Exceptions
CodeCommit.Client.exceptions.RepositoryNameRequiredExceptionCodeCommit.Client.exceptions.RepositoryDoesNotExistExceptionCodeCommit.Client.exceptions.InvalidRepositoryNameExceptionCodeCommit.Client.exceptions.BranchNameRequiredExceptionCodeCommit.Client.exceptions.InvalidBranchNameExceptionCodeCommit.Client.exceptions.DefaultBranchCannotBeDeletedExceptionCodeCommit.Client.exceptions.EncryptionIntegrityChecksFailedExceptionCodeCommit.Client.exceptions.EncryptionKeyAccessDeniedExceptionCodeCommit.Client.exceptions.EncryptionKeyDisabledExceptionCodeCommit.Client.exceptions.EncryptionKeyNotFoundExceptionCodeCommit.Client.exceptions.EncryptionKeyUnavailableException