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

*************
create_branch
*************



.. py:method:: CodeCommit.Client.create_branch(**kwargs)

  

  Creates a branch in a repository and points the branch to a commit.

   

  .. note::

    

    Calling the create branch operation does not set a repository's default branch. To do this, call the update default branch operation.

    

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/codecommit-2015-04-13/CreateBranch>`_  


  **Request Syntax**
  ::

    response = client.create_branch(
        repositoryName='string',
        branchName='string',
        commitId='string'
    )
    
  :type repositoryName: string
  :param repositoryName: **[REQUIRED]** 

    The name of the repository in which you want to create the new branch.

    

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

    The name of the new branch to create.

    

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

    The ID of the commit to point the new branch to.

    

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

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

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

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

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

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

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

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

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

  
  *   :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`

  