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.

update_default_branch

update_default_branch(**kwargs)

Sets or changes the default branch name for the specified repository.

Note

If you use this operation to change the default branch name to the current default branch name, a success message is returned even though the default branch did not change.

See also: AWS API Documentation

Request Syntax

response = client.update_default_branch(
    repositoryName='string',
    defaultBranchName='string'
)
Parameters
  • repositoryName (string) --

    [REQUIRED]

    The name of the repository to set or change the default branch for.

  • defaultBranchName (string) --

    [REQUIRED]

    The name of the branch to set as the default.

Returns

None

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