Search This Blog

Wednesday, May 3, 2023

Sync AWS code commit repo to github

 Existing code in aws code commit, need to sync that to github


  1. clone repo to local
    1. git clone --mirror https://git-codecommit.us-east-2.amazonaws.com/v1/repos/myRepo.git
  2. go to local dir after clone
    1. cd myRepo.git
  3. add remote repo location this is the github location
    1. git remote add --mirror=fetch secondary git@github.com:company/myRepo.git
  4. fetch all branches from aws code commit( origin) and push all that to github(secondary)
    1. git fetch origin
    2. git push secondary --all
  5. future changes
    git fetch origin
    git push --mirror git@github.com:username/repo.git