What is CodeCommit?
CodeCommit is a managed source control service by AWS that allows users to store, manage, and version their source code and artifacts securely and at scale. It supports Git, integrates with other AWS services, enables collaboration through branch and merge workflows, and provides audit logs and compliance reports to meet regulatory requirements and track changes. Overall, CodeCommit provides developers with a reliable and efficient way to manage their codebase and set up a CI/CD pipeline for their software development projects.
Task-01 :
Set up a code repository on CodeCommit and clone it on your local.
Log in to the AWS Management Console and navigate to CodeCommit.
Click on Create Repository.
Enter a name for your repository and click on 'Create'
Repository is created
You need to set up GitCredentials in your AWS IAM.
Go to IAM console
Click on Users in the left-hand menu, and then click on your username.
Scroll down to the Security credentials section.
Click on HTTPS Git credentials for AWS CodeCommit > Generate credentials
Click on the Download credentials button to download your Git credentials and click on 'close'.
Use those credentials in your local and then clone the repository from CodeCommit
In Code Commit, Go inside your repository that you created in the above steps, in the right-hand side click on 'Clone URL' and choose 'Clone HTTPS'.
Task-02 :
Add a new file from local and commit to your local branch
Create a new file in the local repository directory.
Check status using the command 'git status'.
Add the new file to your local branch using the following command:
Commit the changes to your local branch using the following command:
git commit -m "added new file"
Push the local changes to the CodeCommit repository.
Push the changes from your local branch to the CodeCommit repository using the following command:
git push origin master
Verify that the changes have been pushed to the CodeCommit repository:
Go to the code commit repository that you created earlier, you should see the new file listed in the repository's files.
Happy Learning!