Skip to content

CodeCommit

CloudMock emulates AWS CodeCommit, supporting repository management, branches, pull requests, commits, and diffs.

OperationStatusNotes
CreateRepositorySupportedCreates a repository
GetRepositorySupportedReturns repository details
ListRepositoriesSupportedLists all repositories
DeleteRepositorySupportedDeletes a repository
UpdateRepositoryNameSupportedRenames a repository
UpdateRepositoryDescriptionSupportedUpdates repository description
CreateBranchSupportedCreates a branch
GetBranchSupportedReturns branch details
ListBranchesSupportedLists branches in a repository
DeleteBranchSupportedDeletes a branch
CreatePullRequestSupportedCreates a pull request
GetPullRequestSupportedReturns pull request details
ListPullRequestsSupportedLists pull requests
UpdatePullRequestStatusSupportedUpdates pull request status
MergePullRequestBySquashSupportedMerges a pull request via squash
GetCommitSupportedReturns commit details
GetDifferencesSupportedReturns differences between commits
import { CodeCommitClient, CreateRepositoryCommand } from '@aws-sdk/client-codecommit';
const client = new CodeCommitClient({
endpoint: 'http://localhost:4566',
region: 'us-east-1',
credentials: { accessKeyId: 'test', secretAccessKey: 'test' },
});
const { repositoryMetadata } = await client.send(new CreateRepositoryCommand({
repositoryName: 'my-repo',
repositoryDescription: 'My test repository',
}));
console.log(repositoryMetadata.repositoryId);
import boto3
client = boto3.client('codecommit',
endpoint_url='http://localhost:4566',
region_name='us-east-1',
aws_access_key_id='test',
aws_secret_access_key='test')
response = client.create_repository(
repositoryName='my-repo',
repositoryDescription='My test repository')
print(response['repositoryMetadata']['repositoryId'])
cloudmock.yml
services:
codecommit:
enabled: true
  • No actual Git repository is created; data is stored in-memory
  • Commits and diffs are stubs
  • Merge operations update status but do not perform real merges