AWS CodeCommit is a fully managed source control service that makes it easy for teams to collaborate securely on source code in private Git repositories.
Access the AWS CodeCommit service or through the link AWS CodeCommit
Choose Create Repository
In the Create Repository interface:
In the Repository name field, enter workshop-codecommit
Scroll down to the bottom of the page and select Create
In the CodeCommit Repositories interface, select the repository you just created (workshop-codecommit
). Under Connection Steps, save the repository URL.
Log in to AWS CLI and git
👉 To push source code to CodeCommit, you first need to add CodeCommit authentication information to Git using AWS Credentials.
aws configure
command to authenticate AWS CLI. If you are not familiar with this, you can refer to the tutorial Authenticate with IAM user credentials.# Login to aws cli
aws configure
# Configure Git to use aws codecommit credential-helper
git config --global credential.helper '!aws codecommit credential-helper $@'
# Enable using HTTP path for Git
git config --global credential.UseHttpPath true
Hugo project source code Download Source
Finally, push the source code to CodeCommit by following these steps:
git init
git remote add origin https://git-codecommit.ap-southeast-1.amazonaws.com/v1/repos/workshop-codecommit
git add .
git commit -m "first commit"
git push --set-upstream origin master
Note: https://git-codecommit.ap-southeast-1.amazonaws.com/v1/repos/workshop-codecommit is the path to the codecommit repo URL obtained in step 4 (In the Connection Steps section).
Once completed, your source code has been successfully pushed to AWS CodeCommit.