aws codecommit create-repository --repository-name fcj-book-store-backend
You should see output similar to the following:
{
"repositoryMetadata": {
"accountId": "111111111111",
"repositoryId": "b782c34e-77dc-4627-8aea-ae8bd5ea46c3",
"repositoryName": "fcj-book-store-backend",
"lastModifiedDate": "2022-09-19T11:49:51.325000+07:00",
"creationDate": "2022-09-19T11:49:51.325000+07:00",
"cloneUrlHttp": "https://git-codecommit.ap-southeast-1.amazonaws.com/v1/repos/fcj-book-store-backend",
"cloneUrlSsh": "ssh://git-codecommit.ap-southeast-1.amazonaws.com/v1/repos/fcj-book-store-backend",
"Arn": "arn:aws:codecommit:ap-southeast-1:111111111111:fcj-book-store-backend"
}
}
git init -b main
echo -e "\n\n.aws-sam" >> .gitignore
git add .
git commit -m "Initial commit"
git remote add origin codecommit://fcj-book-store-backend
If origin already exists or url is wrong, can remove it by running: git remote rm origin
git push -u origin main