This article is just to document my task for future reference. Below is the step-by-step instruction on how to migrate an AWS code commit repository to another AWS Code Commit. This need usually occur if you are transferring to a new AWS account and you want to terminate your old AWS account.
Here are the steps.
- Open a terminal or command prompt window
- Run a git clone command with mirror option by typing git clone –mirror url-of-your-old-repository local-mirror-folder . Example: git clone –mirror https://github.com/awslabs/aws-demo-php-simple-app.git aws-codecommit-demo
- Change directories to the directory where you made the clone. Example. cd aws-codecommit-demo
- Run the git push command, specifying the URL and name of the destination CodeCommit repository and the –all option. Example git push https://git-codecommit.us-east-2.amazonaws.com/v1/repos/MyClonedRepository –all
You may now clone the new repository to your local machine for