Repository

2. Create the git repository

We will use AWS CodeCommit to host your site’s repository. CodeCommit is included in the AWS Free Tier.

Using CodeCommit

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 git-remote-codecommit tool (A Git Remote Helper that makes it easier to interact with AWS CodeCommit). Install the tool by running the following command in the terminal of your Cloud9 environment.

sudo pip install git-remote-codecommit

Next you need to create the repository and clone it to your Cloud9 environment:

aws codecommit create-repository \
  --repository-name wild-rydes
  1. Clone the template repository using git clone --bare.

    git clone --bare https://github.com/bls20AWS/wildRydesVue.git
    
  2. push --mirror to your new repository.

    cd wildRydesVue.git
    git push --mirror codecommit://wild-rydes
    
  3. Remove the temporary local repository you created in step2

    cd ..
    rm -rf wildRydesVue.git
    
  4. Clone the new repository to your Development environment

    git clone codecommit://wild-rydes
    
  5. Make sure you’re on the master branch

    aws codecommit update-default-branch \
    --repository-name wild-rydes \
    --default-branch-name master
    
    cd wild-rydes
    git checkout master