use of software.amazon.awssdk.services.codecommit.model.CreateBranchRequest in project aws-doc-sdk-examples by awsdocs.
the class CreateBranch method createSpecificBranch.
// snippet-start:[codecommit.java2.create_branch.main]
public static void createSpecificBranch(CodeCommitClient codeCommitClient, String repoName, String branchName, String commitId) {
try {
CreateBranchRequest branchRequest = CreateBranchRequest.builder().branchName(branchName).repositoryName(repoName).commitId(commitId).build();
codeCommitClient.createBranch(branchRequest);
System.out.println("Branch " + branchName + " was created");
} catch (CodeCommitException e) {
System.err.println(e.getMessage());
System.exit(1);
}
}
Aggregations