There is no need to track the .aws-sam directory or the packaged.yaml under version control as they are re-generated on every build. We will paste the following into a
Create the file
cd ~/environment/sam-app touch .gitignore
In Cloud9, remember to enable hidden files:
.gitignore file and paste the two lines below.
Remember to save the file (File> Save or CMD +S etc)
From the root directory of your sam-app project, run the following commands:
cd ~/environment/sam-app git init git add . git commit -m "Initial commit"
Add your CodeCommit repository URL as a remote on your local git project.
git remote add origin codecommit://sam-app
If you typed the origin url incorrectly, you can remove it by running:
git remote rm origin.
Now, push the code:
git push -u origin master
Navigate to the AWS CodeCommit console, find your sam-app repository and click on it to view its contents. Make sure your code is there. You should see a screen like the following: