Understanding AWS CodeCommit: 

  • fully-managed source control service
  • Can host secure and highly scalable private Git repositories.
  • integrates with AWS CodePipeline and AWS CodeDeploy.
  • Based on Git
  • Centralized repository for all code, binaries, images, and libraries
  • Tracks and manages code changes
  • Maintains version history
  • multiple sources can be used to update the stored code
  • collaboration facilityis also provided
  • can host private Git repositories
  • the AWS service is both secured and highly scalable
  • Maximum Number of repositories per account:  1000

Working

Understanding AWS CodeCommit
  1. Use the AWS CLI/CodeCommit console for creating CodeCommit repository.
  2. From development machine, use Git to run git clone command, with name of CodeCommit repository to create local repo connected to CodeCommit repository.
  3. Use local repo on development machine to make changes – add/ edit/delete files, and then run git add command for staging modified files locally. After which, run git commit command for committing files locally, and then run git push command to send files to CodeCommit repository.
  4. Run git pull command to synchronize files in CodeCommit repository with local repo and download changes from other users to work with latest version of files.

Tasks include:

  • Create a CodeCommit Repository
  • Add Files to Repository
  • Browse the Contents of Repository
  • Create and Collaborate on a Pull Request

CodeCommit Repositories

  • A repository version control object in CodeCommit.
  • It stores code and files for project.
  • It has project history starting from the very first commit till the latest changes.
  • repository can also be shared with other users working on the project.
  • AWS tags can easily perform identification of repositories
  • With tags, notifications can easily set to repository users about events
  • Can change default settings for repository
  • can create triggers for repository for code push or other events trigger actions
Understanding AWS CodeCommit
  • Create empty CodeCommit repository from
    • AWS CLI
    • CodeCommit console
  • CLI also provide facility to add tags to repository during creation
  • Post repository creation, connect to it and add code.
  • During first connection, its contents are cloned to local machine.
  • Can add files to and edit files in a repository directly from CodeCommit console.

CodeCommit Files

  • It is a version-controlled, self-contained piece of information
  • Files can access using:
    • repository users
    • branch storing the file
  • repository files can organize similar to directory structure
  • Changes to file automatically tracked by CodeCommit
  • Can compare versions of file and store different versions of a file in different repository branches.

To add or edit a file in a repository, use

  • Git client
  • CodeCommit console,
  • AWS CLI
  • CodeCommit API.
example

CodeCommit Commits

  • Commits are snapshots of contents and changes to repository
  • commit information is saved for every user
  • Meta information includes
    • who committed the change
    • the date and time of the commit
    • changes made as part of the commit
  • tags can be added to commits, for easy identification
  • In CodeCommit, can:
    • Review commits.
    • View the history of commits in a graph.
    • Compare a commit to its parent or to another specifier.
    • Add comments to commits and reply to comments made by others.
  • CodeCommit console can browse commit history for a repository.
  • Can also view a graph of commits in repository and its branches over time.
Menu