./ Alex Tech Blog / Using AWS Code Commit

Using AWS Code Commit

aws codecommit

Making sure the AWS CLI is proper installed in the computer

$ aws sts get-caller-identity

It should show your account information

    "Account": "123456789012",
    "Arn": "arn:aws:iam::123456789012:user/Alice"

Ensure CodeCommit is installed

$ aws codecommit help

Setting up your CodeCommit repository

Create CodeCommit repository

$ aws codecommit create-repository --repository-name <repository name>

Initialize a new git repository

$ git init

Add your CodeCommit repository as a remote

$ git remote add origin codecommit://<repository name>

After all the configuration is done you can run the common Git commands like Push the code to your new CodeCommit repository

$ git push -u origin master