:doc:`CodeCommit <../../codecommit>` / Client / update_default_branch

*********************
update_default_branch
*********************



.. py:method:: CodeCommit.Client.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 <https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/UpdateDefaultBranch>`_  


  **Request Syntax**
  ::

    response = client.update_default_branch(
        repositoryName='string',
        defaultBranchName='string'
    )
    
  :type repositoryName: string
  :param repositoryName: **[REQUIRED]** 

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

    

  
  :type defaultBranchName: string
  :param defaultBranchName: **[REQUIRED]** 

    The name of the branch to set as the default branch.

    

  
  
  :returns: None
  **Exceptions**
  
  *   :py:class:`CodeCommit.Client.exceptions.RepositoryNameRequiredException`

  
  *   :py:class:`CodeCommit.Client.exceptions.RepositoryDoesNotExistException`

  
  *   :py:class:`CodeCommit.Client.exceptions.InvalidRepositoryNameException`

  
  *   :py:class:`CodeCommit.Client.exceptions.BranchNameRequiredException`

  
  *   :py:class:`CodeCommit.Client.exceptions.InvalidBranchNameException`

  
  *   :py:class:`CodeCommit.Client.exceptions.BranchDoesNotExistException`

  
  *   :py:class:`CodeCommit.Client.exceptions.EncryptionIntegrityChecksFailedException`

  
  *   :py:class:`CodeCommit.Client.exceptions.EncryptionKeyAccessDeniedException`

  
  *   :py:class:`CodeCommit.Client.exceptions.EncryptionKeyDisabledException`

  
  *   :py:class:`CodeCommit.Client.exceptions.EncryptionKeyNotFoundException`

  
  *   :py:class:`CodeCommit.Client.exceptions.EncryptionKeyUnavailableException`

  