Question

I have an existing git repository in Bitbucket. I want to clone everything, including tags and branches to another git repository, for example AWS CodeCommit. Use case is disaster recovery in the remote scenario that Bitbucket becomes inaccessible, or Atlassian suddenly goes bankrupt. What is the easiest way to do it?

Short Answer

git clone --mirror git@bitbucket.org/upstream-repository.git
cd upstream-repository.git
git push --mirror ssh://git-codecommit.aws-region.amazonaws.com/v1/repos/new-location.git

Ardee Aram

Cloud Architect. Experienced Node.js Developer. Husband. Father. Problem Solver. Eternal Student of Life. https://ardeearam.io