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

Create an AWS CodeCommit Repository

Use AWS CLI or the CodeCommit console to create an empty CodeCommit repository.

These instructions are written with the assumption that you have already completed the steps in Setting Up .

Note

Depending on your usage, you might be charged for creating or accessing a repository. For more information, see Pricing on the CodeCommit product information page.

Create a Repository (Console)

To create a CodeCommit repository

  1. Open the CodeCommit console at https://console.aws.amazon.com/codesuite/codecommit/home.

  2. In the region selector, choose the AWS Region where you want to create the repository. For more information, see Regions and Git Connection Endpoints.

  3. On the Repositories page, choose Create repository.

  4. On the Create repository page, in Repository name, enter a name for the repository.

    Note

    This name must be unique in the AWS Region for your AWS account.

  5. (Optional) In Description, enter a description for the repository. This can help you and other users identify the purpose of the repository.

    Note

    The description field displays Markdown in the console and accepts all HTML characters and valid Unicode characters. If you are an application developer who is using the GetRepository or BatchGetRepositories APIs and you plan to display the repository description field in a web browser, see the CodeCommit API Reference.

  6. Choose Create.

After you create a repository, you can connect to it and start adding code either through the CodeCommit console or a local Git client, or by integrating your CodeCommit repository with your favorite IDE. For more information, see Setting Up for AWS CodeCommit . You can also add your repository to a continuous delivery pipeline. For more information, see Simple Pipeline Walkthrough.

To get information about the new CodeCommit repository, such as the URLs to use when cloning the repository, choose the repository's name from the list, or just choose the connection protocol you want to use next to the repository's name.

To share this repository with others, you must send them the HTTPS or SSH link to use to clone the repository. Make sure they have the permissions required to access the repository. For more information, see Share a Repository and Authentication and Access Control for AWS CodeCommit.

Create a Repository (AWS CLI)

To create a CodeCommit repository:

  1. Make sure that you have configured the AWS CLI with the AWS Region where the repository exists. To verify the AWS Region, run the following command at the command line or terminal and review the information for default region name:

    aws configure

    The default region name must match the AWS Region for the repository in CodeCommit. For more information, see Regions and Git Connection Endpoints.

  2. Run the create-repository command, specifying:

    • A name that uniquely identifies the CodeCommit repository (with the --repository-name option).

      Note

      This name must be unique across an AWS account.

    • An optional comment about the CodeCommit repository (with the --repository-description option).

    For example, to create a CodeCommit repository named MyDemoRepo with the description "My demonstration repository":

    aws codecommit create-repository --repository-name MyDemoRepo --repository-description "My demonstration repository"

    Note

    The description field displays Markdown in the console and accepts all HTML characters and valid Unicode characters. If you are an application developer who is using the GetRepository or BatchGetRepositories APIs and you plan to display the repository description field in a web browser, see the CodeCommit API Reference.

  3. If successful, this command outputs a repositoryMetadata object with the following information:

    • The description (repositoryDescription).

    • The unique, system-generated ID (repositoryId).

    • The name (repositoryName).

    • The ID of the AWS account associated with the CodeCommit repository (accountId).

    Here is some example output, based on the preceding example command:

    { "repositoryMetadata": { "repositoryName": "MyDemoRepo", "repositoryDescription": "My demonstration repository", "repositoryId": "f7579e13-b83e-4027-aaef-650c0EXAMPLE", "accountId": "creator-account-ID" } }
  4. Make a note of the name and ID of the CodeCommit repository. You need them to monitor and change information about the CodeCommit repository, especially if you use AWS CLI.

    If you forget the name or ID, follow the instructions in View CodeCommit Repository Details (AWS CLI).

After you create a repository, you can connect to it and start adding code. For more information, see Connect to a Repository. You can also add your repository to a continuous delivery pipeline. For more information, see Simple Pipeline Walkthrough.