将 Git 存储库从 GCP 迁移到 AWS

时间:2021-04-16 12:07:11

标签: git amazon-web-services google-cloud-platform

将包含所有分支和完整历史记录的 Git 存储库从 Google Cloud 移动到 AWS 云的最佳方法是什么?是否有我必须使用的脚本或命令列表?

1 个答案:

答案 0 :(得分:0)

我认为您正在寻找的是 --mirrorgit clonegit push 选项:

# clone repository from old location
git clone --mirror git clone old-url/my-repo
cd my-repo

# point the url for `origin` at your new repository
git remote set-url origin new-url/my-repo

# push all references to the new repository
git push --mirror origin

old-urlnew-url 替换为您的 Google Cloud 和 AWS Cloud 存储库的相应存储库 URL。