Method: Aws::CodeCommit::Client#create_branch

Defined in:
lib/aws-sdk-codecommit/client.rb

#create_branch(params = {}) ⇒ Struct

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

<note markdown=“1”> Calling the create branch operation does not set a repository’s default branch. To do this, call the update default branch operation.

</note>

Examples:

Request syntax with placeholder values


resp = client.create_branch({
  repository_name: "RepositoryName", # required
  branch_name: "BranchName", # required
  commit_id: "CommitId", # required
})

Parameters:

  • params (Hash) (defaults to: {})

    ({})

Options Hash (params):

  • :repository_name (required, String)

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

  • :branch_name (required, String)

    The name of the new branch to create.

  • :commit_id (required, String)

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

Returns:

  • (Struct)

    Returns an empty response.

See Also:



969
970
971
972
# File 'lib/aws-sdk-codecommit/client.rb', line 969

def create_branch(params = {}, options = {})
  req = build_request(:create_branch, params)
  req.send_request(options)
end