:doc:`CodeCatalyst <../../codecatalyst>` / Client / create_source_repository_branch

*******************************
create_source_repository_branch
*******************************



.. py:method:: CodeCatalyst.Client.create_source_repository_branch(**kwargs)

  

  Creates a branch in a specified source repository in Amazon CodeCatalyst.

   

  .. note::

    

    This API only creates a branch in a source repository hosted in Amazon CodeCatalyst. You cannot use this API to create a branch in a linked repository.

    

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/codecatalyst-2022-09-28/CreateSourceRepositoryBranch>`_  


  **Request Syntax**
  ::

    response = client.create_source_repository_branch(
        spaceName='string',
        projectName='string',
        sourceRepositoryName='string',
        name='string',
        headCommitId='string'
    )
    
  :type spaceName: string
  :param spaceName: **[REQUIRED]** 

    The name of the space.

    

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

    The name of the project in the space.

    

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

    The name of the repository where you want to create a branch.

    

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

    The name for the branch you're creating.

    

  
  :type headCommitId: string
  :param headCommitId: 

    The commit ID in an existing branch from which you want to create the new branch.

    

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

    
    ::

      {
          'ref': 'string',
          'name': 'string',
          'lastUpdatedTime': datetime(2015, 1, 1),
          'headCommitId': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **ref** *(string) --* 

        The Git reference name of the branch.

        
      

      - **name** *(string) --* 

        The name of the newly created branch.

        
      

      - **lastUpdatedTime** *(datetime) --* 

        The time the branch was last updated, in coordinated universal time (UTC) timestamp format as specified in `RFC 3339 <https://www.rfc-editor.org/rfc/rfc3339#section-5.6>`__.

        
      

      - **headCommitId** *(string) --* 

        The commit ID of the tip of the newly created branch.

        
  
  **Exceptions**
  
  *   :py:class:`CodeCatalyst.Client.exceptions.ThrottlingException`

  
  *   :py:class:`CodeCatalyst.Client.exceptions.ConflictException`

  
  *   :py:class:`CodeCatalyst.Client.exceptions.ValidationException`

  
  *   :py:class:`CodeCatalyst.Client.exceptions.ServiceQuotaExceededException`

  
  *   :py:class:`CodeCatalyst.Client.exceptions.ResourceNotFoundException`

  
  *   :py:class:`CodeCatalyst.Client.exceptions.AccessDeniedException`

  