use of software.amazon.awssdk.services.codecommit.model.MergeBranchesByFastForwardRequest in project aws-doc-sdk-examples by awsdocs.
the class MergeBranches method merge.
// snippet-start:[codecommit.java2.merge.main]
public static void merge(CodeCommitClient codeCommitClient, String repoName, String targetBranch, String sourceReference, String destinationCommitId) {
try {
MergeBranchesByFastForwardRequest fastForwardRequest = MergeBranchesByFastForwardRequest.builder().destinationCommitSpecifier(destinationCommitId).targetBranch(targetBranch).sourceCommitSpecifier(sourceReference).repositoryName(repoName).build();
MergeBranchesByFastForwardResponse response = codeCommitClient.mergeBranchesByFastForward(fastForwardRequest);
System.out.println("The commit id is " + response.commitId());
} catch (CodeCommitException e) {
System.err.println(e.getMessage());
System.exit(1);
}
}
Aggregations