Created
November 4, 2020 11:23
-
-
Save anilshrish/f7d4373551363e7eb53eba412a971a73 to your computer and use it in GitHub Desktop.
Revisions
-
anilshrish created this gist
Nov 4, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,45 @@ #### Clone git repo ``` git clone --mirror https://github.com/miztiik/lex-faq-bot.git __tmp cd __tmp ``` #### Git push to repo1 ``` git push https://github.com/anilshrish/lex-faq-bot1.git --all git push https://github.com/anilshrish/lex-faq-bot1.git --tags ``` #### Git push to repo2 ``` git push https://github.com/anilshrish/lex-faq-bot2.git --all git push https://github.com/anilshrish/lex-faq-bot2.git --tags ``` ### Migrate git repository to aws codeCommit: ``` migration_dir="./_trash" git_url="https://github.com/miztiik/lex-faq-bot.git" aws_region="us-west-2" codecommit_repo_name="lex-faq-bot" # Initiate Migration # Create CodeCommit Repo aws codecommit create-repository \ --repository-name ${codecommit_repo_name} \ --repository-description "${codecommit_repo_name}" --profile default # 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 https://git-codecommit.${aws_region}.amazonaws.com/v1/repos/${codecommit_repo_name} --all git push https://git-codecommit.${aws_region}.amazonaws.com/v1/repos/${codecommit_repo_name} --tags # CleanUp - Remove local copy rm -rf ${migration_dir} ```