Markdown Instructions for an Internal CodeCommit User’s Manual
Cloning a repository from AWS CodeCommit involves creating a copy of a repository on your local machine. Here are the steps you need to follow to clone a repository:
- Setting up the Environment:
- Ensure that you have installed the latest version of Git. You can download it from here.
- Install the AWS CLI (Command Line Interface). Instructions can be found here.
- Configure the AWS CLI with your credentials. You can follow these instructions.
- Get the Clone URL of the Repository:
- Navigate to the AWS Management Console.
- Open the CodeCommit console at https://console.aws.amazon.com/codecommit.
- In the region selector, choose the AWS Region where the repository was created.
- In the navigation pane, choose
Repositories
. - In the
Repositories
pane, choose the name of the repository you want to clone. - In the repository details pane, choose
Clone URL
, and then choose the protocol you want to use. You can usehttps
orssh
. - To copy the clone URL to your clipboard, choose the copy icon.
- Clone the Repository:
- Open your terminal.
- Navigate to the directory where you want to clone the repository.
- Run the following command, replacing
clone_url
with the URL you just copied:
git clone clone_url
Example:
git clone https://git-codecommit.us-east-2.amazonaws.com/v1/repos/MyDemoRepo
- If you're prompted for a username and password, provide your AWS credentials.
- Verify the Repository:
- Go to the directory of the cloned repository.
cd MyDemoRepo
- Run the following command to see the structure of the repository:
git log --oneline --decorate --all --graph
- The output should show the structure of the repository with all branches and commits.
Please note: For SSH connections, you need to configure your SSH keys in IAM. For HTTPS connections, you need to generate a git credentials file. Instructions for both can be found here.