Menu
AWS CodeCommit
User Guide (API Version 2015-04-13)

AWS CodeCommit Command Line Reference

This reference will help you learn how to use AWS CLI.

To install and configure the AWS CLI

  1. On your local machine, download and install the AWS CLI. This is a prerequisite for interacting with AWS CodeCommit from the command line. For more information, see Getting Set Up with the AWS Command Line Interface.

    Note

    AWS CodeCommit works only with AWS CLI versions 1.7.38 and later. To determine which version of the AWS CLI you have installed, run the aws --version command.

    To upgrade an older version of the AWS CLI to the latest version, see Installing the AWS Command Line Interface.

  2. Run this command to verify the AWS CodeCommit commands for the AWS CLI are installed:

    Copy
    aws codecommit help

    This command should return a list of AWS CodeCommit commands.

  3. Configure the AWS CLI with the configure command, as follows:

    Copy
    aws configure

    When prompted, specify the AWS access key and AWS secret access key of the IAM user you will use with AWS CodeCommit. Also, be sure to specify the region where the repository exists, such as us-east-2. When prompted for the default output format, specify json. For example:

    Copy
    AWS Access Key ID [None]: Type your target AWS access key ID here, and then press Enter AWS Secret Access Key [None]: Type your target AWS secret access key here, and then press Enter Default region name [None]: Type a supported region for AWS CodeCommit here, and then press Enter Default output format [None]: Type json here, and then press Enter

    To connect to a repository or a resource in another region, you must re-configure the AWS CLI with the default region name for that region. Supported default region names for AWS CodeCommit include:

    • us-east-2

    • us-east-1

    • eu-west-1

    • us-west-2

    • ap-northeast-1

    • ap-southeast-1

    • ap-southeast-2

    • eu-central-1

    • ap-northeast-2

    • sa-east-1

    • us-west-1

    • eu-west-2

    • ap-south-1

    • ca-central-1

    For more information about AWS CodeCommit and regions, see Regions and Git Connection Endpoints. For more information about IAM, access keys, and secret keys, see How Do I Get Credentials? and Managing Access Keys for IAM Users.

To view a list of all available AWS CodeCommit commands, run the following command:

Copy
aws codecommit help

To view information about a specific AWS CodeCommit command, run the following command, where command-name is the name of the command (for example, create-repository):

Copy
aws codecommit command-name help

To learn how to use the commands in AWS CLI, go to one or more of the following sections: