Search⌘ K
AI Features

Working with Branches in CodeCommit

Explore how to work with branches in AWS CodeCommit, including creating, listing, viewing, and deleting branches. Understand how to add files to branches and manage version control effectively with AWS CLI commands.

Working with branches

A branch is simply a folder or a separate place where a developer/collaborator can organize their work without affecting other works in the main repository. There is usually a default branch that serves as a central place where the latest changes are stored. This default branch is usually named the main branch, master branch, but can be any other name chosen by a development team.

Adding files to a repository

To quickly get started with CodeCommit, new files can be created right from the AWS CLI or uploaded using Git from a local computer.

Note: When a new repository is created, it is empty, and initial configurations need to be done. The fastest way to get the repository ready is by creating a new file from the console. The other option includes cloning the repository using an HTTPS/SSH connection, making changes, and then pushing the changes back to the repository.

Files can be added to a branch using the put-file command as shown below:

aws codecommit put-file --repository-name
...