LinuxCommandLibrary

aws-codecommit

Manage AWS CodeCommit repositories

TLDR

Display help

$ aws codecommit help
copy

Display help for a specific command
$ aws codecommit [command] help
copy

SYNOPSIS

aws codecommit SUBCOMMAND [--options] [args]

PARAMETERS

--repository-name (string)
    Name of the CodeCommit repository (required for most subcommands).

--branch-name (string)
    Name of the branch to operate on.

--commit-id (string)
    ID of the commit.

--region (string)
    AWS Region (e.g., us-east-1). Overrides config.

--output (string)
    Output format: json|text|table.

--query (string)
    JMESPath expression to filter output.

--cli-input-json (string)
    Perform action from JSON file.

--generate-cli-skeleton (string)
    Prints JSON skeleton for command.

DESCRIPTION

aws codecommit is part of the AWS Command Line Interface (CLI) for interacting with AWS CodeCommit, a managed source control service hosting secure Git repositories. It enables operations like creating, listing, deleting repositories, managing branches, commits, pull requests, approval rules, triggers, and notifications.

Users configure AWS credentials via IAM users, roles, or access keys, supporting HTTPS Git with IAM auth or SSH. Integrates with CI/CD tools like CodePipeline, CodeBuild. Requires AWS CLI v1 or v2 installed ("pip install awscli" or package manager).

Typical workflow: aws codecommit create-repository --repository-name MyRepo, then git clone https://git-codecommit.us-east-1.amazonaws.com/v1/repos/MyRepo. Supports batch operations, encryption, lifecycle policies for cost control. Outputs JSON by default; use --query for filtering.

CAVEATS

Requires AWS CLI installed and configured (aws configure). Git operations need IAM policies like codecommit:GitPull. No direct file management; use Git. Rate limits apply. SSH needs custom setup.

COMMON SUBCOMMANDS

create-repository, delete-repository, list-repositories, get-repository, create-branch, list-branches, create-pull-request, list-pull-requests.

GIT INTEGRATION

Use git remote add origin https://git-codecommit.<region>.amazonaws.com/v1/repos/<name>; IAM auth via signed HTTPS.

HISTORY

Introduced with AWS CodeCommit launch in 2015 as part of AWS CLI v1. CLI v2 (2018) improved performance. Subcommands expanded with features like pull requests (2017), approval rules (2019), encryption (2020).

SEE ALSO

aws(1), git(1), ssh(1)

Copied to clipboard