Package: git-remote-codecommit
git-remote-codecommitThis package provides a simple method for pushing and pulling fromAWS
CodeCommit. This package extendsgitto support repository URLs prefixed withcodecommit://. For example, if using IAM…% cat ~/.aws/config
[profile demo-profile]
region = us-east-2
output = json

% cat ~/.aws/credentials
[demo-profile]
aws_access_key_id = AKIAIOSFODNN7EXAMPLE
aws_secret_access_key = wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY… you can clone repositories as simply as…% git clone codecommit://demo-profile@MyRepositoryNameThegit-remote-codecommitpackage works on Python versions:3.8.x3.9.x3.10.x3.11.xPrerequisitesBefore you can usegit-remote-codecommit, you must:Complete initial configuration for AWS CodeCommit, including:Creating an AWS accountConfiguring an IAM user or roleAttaching a policy to that user/role that allows access to AWS CodeCommit repositoriesCreate an AWS CodeCommit repository (or have one already) in your AWS account.Install Python and its package manager, pip, if they are not already installed. To download and install the latest version of Python,visit the Python website.Install Git on your Linux, macOS, Windows, or Unix computer.Install the latest version of the AWS CLI on your Linux, macOS, Windows, or Unix computer. You can find instructionshere.Note: Installation of the AWS CLI on some operating systems requires pip version 9.0.3 or later. To check your version of pip, open a terminal and type the following command:% pip --versionIf the version is not 9.0.3 or later, run the following commands to update your version of pip:% curl -O https://bootstrap.pypa.io/get-pip.py
% python3 get-pip.py --userSet UpThese instructions show how to set upgit-remote-codecommitwith an IAM user. If you plan to use a role with AWS Single Sign-On (SSO), seethis documentationto help configure your named credential profiles. Once your profile is set up correctly, usage of the remote helper will be the same as if you were using an IAM user (skip to step 3).Step 1: Look Up Your AWS Account ID and IAM User Access KeyLook up and write down the account ID for your AWS account. You will need this information for step 2. If you don’t know how to find your AWS Account ID, learn howhere.Look up and write down the access key for your IAM user, if you do not already have that information stored locally. Learn morehere.Step 2:Configure an AWS credential profileon your local computerOn your local computer, run theaws configure –profilecommand to create an AWS CLI profile to use withgit-remote-codecommit. When prompted, provide your AWS access key, your secret access key, the AWS Region where you created your AWS CodeCommit repository, and the default output format you prefer. For example:% aws configure --profile demo-profile
AWS Access Key ID [None]: ***************
AWS Secret Access Key [None]: ***************
Default region name [None]: us-east-2
Default output format [None]: jsonStep 3: Install git-remote-codecommitOn your Linux, macOS, Windows, or Unix computer, installgit-remote-codecommitusing thepipcommand. For example:% pip install git-remote-codecommitIf you already havegit-remote-codecommitinstalled you can upgrade to the latest version with the–upgradeparameter:% pip install --upgrade git-remote-codecommitStep 4: Clone your repositoryAt the terminal, run thegit clone codecommitcommand, using the name of your profile and the name of your repository. For example:% git clone codecommit://demo-profile@MyRepositoryName
Cloning into 'MyRepositoryName'...
remote: Counting objects: 1753, done.
Receiving objects: 100% (1753/1753), 351.77 KiB | 1.91 MiB/s, done.
Resolving deltas: 100% (986/986), done.Usagegit-remote-codecommitsupports several different URL formats and variants with optional parameters.RepositoryName is a required parameter. If you only supply this parameter, thengit-remote-codecommitwill attempt to use your default profile in the AWS Region configured in that profile. For example, to clone a repository named MyRepositoryName using the default profile:% git clone codecommit://MyRepositoryNameTo specify a specific profile to use, use the profile name. For example, to clone a repository namedMyRepositoryNameusing a profile nameddemo-profile:% git clone codecommit://demo-profile@MyRepositoryNameTo specify an AWS Region different than the one in your profile, use the region parameter. For example, to clone a repository namedMyRepositoryNamein theus-east-1region using a profile nameddemo-profile:% git clone codecommit::us-east-1://demo-profile@MyRepositoryNameGetting HelpWe use GitHub issues for tracking bugs and feature requests and have limited bandwidth to address them. We recommend using the following community resources for getting help:View the official setup steps forHTTPS Connections to AWS CodeCommit with git-remote-codecommit.Check our existing troubleshootingdocumentationto see if your issue has been addressed there.Open a support ticket withAWS Support.Check for an existing thread or start a new one on theAWS CodeCommit forum.If you believe that you have found a bug, pleaseopen an issue.