CmdID / aws / aws codecommit
aws codecommit merge-branches-by-squash
Merges two branches using the squash merge strategy. AWS CLI reference
1 example 10 options Its page in the AWS CLI reference
Examples
To merge two branches using the squash merge strategy
The following merge-branches-by-squash example merges the specified source branch with the specified destination branch in a repository named MyDemoRepo.
aws codecommit merge-branches-by-squash --source-commit-specifier bugfix-bug1234 --destination-commit-specifier bugfix-bug1233 --author-name "Maria Garcia" --email "maria_garcia@example.com" --commit-message "Merging two fix branches to prepare for a general patch." --repository-name MyDemoRepoIdentify--source-commit-specifierThe branch, tag, HEAD, or other fully qualified reference used to identify a commit (for example, a branch name or a full commit ID).--destination-commit-specifierThe branch, tag, HEAD, or other fully qualified reference used to identify a commit (for example, a branch name or a full commit ID).--author-nameThe name of the author who created the commit.--emailThe email address of the person merging the branches.--commit-messageThe commit message for the merge.--repository-nameThe name of the repository where you want to merge two branches.Its output
{
"commitId": "4f178133EXAMPLE",
"treeId": "389765daEXAMPLE"
}For more information, see Compare and Merge Branches in the AWS CodeCommit User Guide.
Options
--author-nameThe name of the author who created the commit.--commit-messageThe commit message for the merge.--conflict-detail-levelThe level of conflict detail to use.--conflict-resolution-strategySpecifies which branch to use when resolving conflicts, or whether to attempt automatically merging two versions of a file.--conflict-resolutionIf AUTOMERGE is the conflict resolution strategy, a list of inputs to use when resolving conflicts during a merge.--destination-commit-specifier, --source-commit-specifierThe branch, tag, HEAD, or other fully qualified reference used to identify a commit (for example, a branch name or a full commit ID).--emailThe email address of the person merging the branches.--keep-empty-foldersIf the commit contains deletions, whether to keep a folder or folder structure if the changes leave the folders empty.--repository-nameThe name of the repository where you want to merge two branches.--target-branchThe branch where the merge is applied.