CodeCommit / Client / get_branch

get_branch#

CodeCommit.Client.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