The git config command is a convenience function that is used to set Git configuration values on a global or local project level. It is best practice to set up your git user.name and user.email when you set up a new Cloud9 environment using the following commands:
git config --global user.name "Full Name"
git config --global user.email email@example.com
After you’ve created an AWS Cloud9 environment, you can configure the AWS CLI credential helper to manage the credentials for connections to your CodeCommit repository. The AWS Cloud9 development environment comes with AWS managed temporary credentials that are associated with your IAM user. You use these credentials with the AWS CLI credential helper. The credential helper allows Git to use HTTPS and a cryptographically signed version of your IAM user credentials or Amazon EC2 instance role whenever Git needs to authenticate with AWS to interact with CodeCommit repositories.
At the terminal, run the following commands to configure the AWS CLI credential helper for HTTPS connections:
git config --global credential.helper '!aws codecommit credential-helper $@' git config --global credential.UseHttpPath true
gitflow is a collection of Git extensions to provide high-level repository operations for Vincent Driessen’s branching model. At the terminal, run the following commands to install gitflow:
curl -OL https://raw.github.com/nvie/gitflow/develop/contrib/gitflow-installer.sh chmod +x gitflow-installer.sh sudo ./gitflow-installer.sh
In this step, you will retrieve a copy of the sample app’s code and create code commit repo to host the code. The pipeline takes code from the source and then performs actions on it.
aws codecommit create-repository --repository-name gitflow-workshop --repository-description "Repository for Gitflow Workshop"
git clone https://git-codecommit.us-east-1.amazonaws.com/v1/repos/gitflow-workshop
The remaining steps in this tutorial assume you have named your AWS CodeCommit repository
gitflow-workshop. If you use a name other than
gitflow-workshop, be sure to use it throughout this tutorial.
You can check if the repository was created here
unzip gitflow.zip -d gitflow-workshop/
git add -A
git committo commit the change and push it to
git commit -m "Initial Commit"
git push origin master
And you should see something similar to:
Counting objects: 17, done. Compressing objects: 100% (16/16), done. Writing objects: 100% (17/17), 49.62 KiB | 4.96 MiB/s, done. Total 17 (delta 1), reused 0 (delta 0) To https://git-codecommit.us-east-1.amazonaws.com/v1/repos/gitflow-workshop * [new branch] master -> master