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

*************
delete_branch
*************



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

  

  Deletes a branch from a repository, unless that branch is the default branch for the repository.

  

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


  **Request Syntax**
  ::

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

    The name of the repository that contains the branch to be deleted.

    

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

    The name of the branch to delete.

    

  
  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'deletedBranch': {
              'branchName': 'string',
              'commitId': 'string'
          }
      }
      
    **Response Structure**

    

    - *(dict) --* 

      Represents the output of a delete branch operation.

      
      

      - **deletedBranch** *(dict) --* 

        Information about the branch deleted by the operation, including the branch name and the commit ID that was the tip of the branch.

        
        

        - **branchName** *(string) --* 

          The name of the branch.

          
        

        - **commitId** *(string) --* 

          The ID of the last commit made to the branch.

          
    
  
  **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.DefaultBranchCannotBeDeletedException`

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

  