- Navigation GuideYou are on a Command (operation) page with structural examples. Use the navigation breadcrumb if you would like to return to the Client landing page.
GetMergeCommitCommand
Returns information about a specified merge commit.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { CodeCommitClient, GetMergeCommitCommand } from "@aws-sdk/client-codecommit"; // ES Modules import
// const { CodeCommitClient, GetMergeCommitCommand } = require("@aws-sdk/client-codecommit"); // CommonJS import
const client = new CodeCommitClient(config);
const input = { // GetMergeCommitInput
repositoryName: "STRING_VALUE", // required
sourceCommitSpecifier: "STRING_VALUE", // required
destinationCommitSpecifier: "STRING_VALUE", // required
conflictDetailLevel: "FILE_LEVEL" || "LINE_LEVEL",
conflictResolutionStrategy: "NONE" || "ACCEPT_SOURCE" || "ACCEPT_DESTINATION" || "AUTOMERGE",
};
const command = new GetMergeCommitCommand(input);
const response = await client.send(command);
// { // GetMergeCommitOutput
// sourceCommitId: "STRING_VALUE",
// destinationCommitId: "STRING_VALUE",
// baseCommitId: "STRING_VALUE",
// mergedCommitId: "STRING_VALUE",
// };
GetMergeCommitCommand Input
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
destinationCommitSpecifier Required | string | undefined | The branch, tag, HEAD, or other fully qualified reference used to identify a commit (for example, a branch name or a full commit ID). |
repositoryName Required | string | undefined | The name of the repository that contains the merge commit about which you want to get information. |
sourceCommitSpecifier Required | string | undefined | The branch, tag, HEAD, or other fully qualified reference used to identify a commit (for example, a branch name or a full commit ID). |
conflictDetailLevel | ConflictDetailLevelTypeEnum | undefined | The level of conflict detail to use. If unspecified, the default FILE_LEVEL is used, which returns a not-mergeable result if the same file has differences in both branches. If LINE_LEVEL is specified, a conflict is considered not mergeable if the same file in both branches has differences on the same line. |
conflictResolutionStrategy | ConflictResolutionStrategyTypeEnum | undefined | Specifies which branch to use when resolving conflicts, or whether to attempt automatically merging two versions of a file. The default is NONE, which requires any conflicts to be resolved manually before the merge operation is successful. |
GetMergeCommitCommand Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
baseCommitId | string | undefined | The commit ID of the merge base. |
destinationCommitId | string | undefined | The commit ID of the destination commit specifier that was used in the merge evaluation. |
mergedCommitId | string | undefined | The commit ID for the merge commit created when the source branch was merged into the destination branch. If the fast-forward merge strategy was used, there is no merge commit. |
sourceCommitId | string | undefined | The commit ID of the source commit specifier that was used in the merge evaluation. |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
CommitDoesNotExistException | client | The specified commit does not exist or no commit was specified, and the specified repository has no default branch. |
CommitRequiredException | client | A commit was not specified. |
EncryptionIntegrityChecksFailedException | server | An encryption integrity check failed. |
EncryptionKeyAccessDeniedException | client | An encryption key could not be accessed. |
EncryptionKeyDisabledException | client | The encryption key is disabled. |
EncryptionKeyNotFoundException | client | No encryption key was found. |
EncryptionKeyUnavailableException | client | The encryption key is not available. |
InvalidCommitException | client | The specified commit is not valid. |
InvalidConflictDetailLevelException | client | The specified conflict detail level is not valid. |
InvalidConflictResolutionStrategyException | client | The specified conflict resolution strategy is not valid. |
InvalidRepositoryNameException | client | A specified repository name is not valid. This exception occurs only when a specified repository name is not valid. Other exceptions occur when a required repository parameter is missing, or when a specified repository does not exist. |
RepositoryDoesNotExistException | client | The specified repository does not exist. |
RepositoryNameRequiredException | client | A repository name is required, but was not specified. |
CodeCommitServiceException | Base exception class for all service exceptions from CodeCommit service. |