There are more AWS SDK examples available in the AWS Doc SDK Examples
Use CreateBranch with a CLI
The following code examples show how to use CreateBranch.
- CLI
-
- AWS CLI
-
To create a branch
The following
create-branchexample creates a branch in an AWS CodeCommit repository.aws codecommit create-branch \ --repository-nameMyDemoRepo\ --branch-nameMyNewBranch\ --commit-id317f8570EXAMPLEThis command produces no output.
For more information, see Create a branch in AWS CodeCommit in the AWS CodeCommit User Guide.
-
For API details, see CreateBranch
in AWS CLI Command Reference.
-
- PowerShell
-
- Tools for PowerShell V4
-
Example 1: This example creates a new branch with the specified name for the specified repository and the specified commit ID.
New-CCBranch -RepositoryName MyDemoRepo -BranchName MyNewBranch -CommitId 7763222d...561fc9c9-
For API details, see CreateBranch in AWS Tools for PowerShell Cmdlet Reference (V4).
-
- Tools for PowerShell V5
-
Example 1: This example creates a new branch with the specified name for the specified repository and the specified commit ID.
New-CCBranch -RepositoryName MyDemoRepo -BranchName MyNewBranch -CommitId 7763222d...561fc9c9-
For API details, see CreateBranch in AWS Tools for PowerShell Cmdlet Reference (V5).
-