aws codecommit create-repository --repository-name fcj-book-store-backend
You should see output similar to the following:
{
"repositoryMetadata": {
"accountId": "111111111111",
"repositoryId": "f4681cc1-d18d-4dbc-9e5b-2b37c54532db",
"repositoryName": "fcjdms-backend",
"lastModifiedDate": "2023-04-07T15:42:09.693000+07:00",
"creationDate": "2023-04-07T15:42:09.693000+07:00",
"cloneUrlHttp": "https://git-codecommit.ap-southeast-1.amazonaws.com/v1/repos/fcjdms-backend",
"cloneUrlSsh": "ssh://git-codecommit.ap-southeast-1.amazonaws.com/v1/repos/fcjdms-backend",
"Arn": "arn:aws:codecommit:ap-southeast-1:111111111111:fcjdms-backend"
}
}
git init -b main
echo -e "\n\n.aws-sam" >> .gitignore
git add .
git commit -m "Initial commit"
git remote add origin codecommit://fcjdms-backend
If origin already exists or url is wrong, can remove it by running: git remote rm origin
git push -u origin main