Skip to content

miztiik/migrate-from-github-to-codecommit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 

Repository files navigation

Migrate from Github to AWS CodeCommit

You can migrate any existing Git repository to a CodeCommit repository. This demo shows you how to migrate a project hosted on Git repository to CodeCommit.

Fig : Migrate from Github to AWS CodeCommit

Follow this article in Youtube

Prerequisites

  1. Setup CodeCommit Get help here

Migration Details

Update the below values to match your requirements

migration_dir="./_trash"
git_url="https://github.com/miztiik/lex-faq-bot.git"
aws_region="eu-central-1"
codecommit_repo_name="lex-faq-bot"

Initiate Migration

# Create CodeCommit Repo
aws codecommit create-repository \
  --repository-name ${codecommit_repo_name} \
  --repository-description "My shiny new chat bot"

# Clone Git to local (only for migration purposes; not for local development)
git clone --mirror ${git_url} ${migration_dir}

# Push the repo to CodeCommit
cd ${migration_dir}
git push ssh://git-codecommit.${aws_region}.amazonaws.com/v1/repos/${repo_name} --all
git push ssh://git-codecommit.${aws_region}.amazonaws.com/v1/repos/${repo_name} --tags

# CleanUp - Remove local copy
rm -rf ${migration_dir}

Support

Please open a GitHub issue.

Feedback

Please open a GitHub issue. I do encourage you to contribute your changes and send me pull request.

References

[1] - AWS Docs - Migrate a Git Repository