AWS CodeCommit Basic Walk Through

Yst@IT
3 min readDec 5, 2019

--

AWS CodeCommit

Introducing CodeCommit

CodeCommit is a secure, highly scalable, managed source control service that hosts private Git repositories. CodeCommit eliminates the need for you to manage your own source control system or worry about scaling its infrastructure. You can use CodeCommit to store anything from code to binaries. It supports the standard functionality of Git, so it works seamlessly with your existing Git-based tools.

Repositories in CodeCommit CANNOT be set to be public accessible.

Walk Through Steps:

  1. Create CodeCommit repository.
  2. Create connection credential.
  3. Setup local environment.
  4. Clone repository to local.
  5. Perform git actions.

Create CodeCommit repository

Name your repository, rest are optional.

AWS CodeCommit

Once created, CodeCommit shows you the options and how to connect to it. For simplicity, I use HTTPS.

You CANNOT use SSH if you login as root user.

AWS CodeCommit

Create Connection Credential

Credential used to access repositories in CodeCommit is created with IAM service. Click on the user you will be using to access your codes. You must grant user with appropriate permission. For more information, please refer here.

AWS CodeCommit

Select Security credentials.

AWS CodeCommit

Scroll down the page, you can create both credentials for SSH and HTTPS access. For this walk through, I will use HTTPS.

AWS CodeCommit

Credential will only show once after clicked “Generate credentials”.

AWS CodeCommit

Finish view with other action can be performed.

AWS CodeCommit

Setup local environment

Setup git (assume you have installed git locally) so git actions can be performed.

git config --global user.email “your@email.com”
git config --global user.name “yourname”

AWS CodeCommit

Clone repository to local

Clone the repository you created on CodeCommit. Enter your username and password obtained from IAM service step.

git clone https://your-repo-url-from-codecommit

AWS CodeCommit

Perform git actions

Put your code into the cloned repository(folder). Use git to add file and push it to CodeCommit repository

git status
git add .
git commit -m “your-comment-here”
git push

AWS CodeCommit

Verify on CodeCommit

Once pushed, check the file on CodeCommit. Click created repository.

AWS CodeCommit

If push successful, you will see the file pushed. Click the file to see the content.

AWS CodeCommit
AWS CodeCommit

That’s it!

--

--

Yst@IT
Yst@IT

Written by Yst@IT

Cloud Solution Architect, focusing on Oracle Cloud Infrastructure currently.