Select your cookie preferences

We use cookies and similar tools to enhance your experience, provide our services, deliver relevant advertising, and make improvements. Approved third parties also use these tools to help us deliver advertising and provide certain site features.

get_branch

get_branch(**kwargs)

Returns information about a repository branch, including its name and the last commit ID.

See also: AWS API Documentation

Request Syntax

response = client.get_branch(
    repositoryName='string',
    branchName='string'
)
Parameters
  • repositoryName (string) -- The name of the repository that contains the branch for which you want to retrieve information.
  • branchName (string) -- The name of the branch for which you want to retrieve information.
Return type

dict

Returns

Response Syntax

{
    'branch': {
        'branchName': 'string',
        'commitId': 'string'
    }
}

Response Structure

  • (dict) --

    Represents the output of a get branch operation.

    • branch (dict) --

      The name 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.RepositoryNameRequiredException
  • CodeCommit.Client.exceptions.RepositoryDoesNotExistException
  • CodeCommit.Client.exceptions.InvalidRepositoryNameException
  • CodeCommit.Client.exceptions.BranchNameRequiredException
  • CodeCommit.Client.exceptions.InvalidBranchNameException
  • CodeCommit.Client.exceptions.BranchDoesNotExistException
  • CodeCommit.Client.exceptions.EncryptionIntegrityChecksFailedException
  • CodeCommit.Client.exceptions.EncryptionKeyAccessDeniedException
  • CodeCommit.Client.exceptions.EncryptionKeyDisabledException
  • CodeCommit.Client.exceptions.EncryptionKeyNotFoundException
  • CodeCommit.Client.exceptions.EncryptionKeyUnavailableException