1). 从原地址克隆一份裸版本库
git clone --bare git://github.com/username/test.git
2). 然后到新的 Git 服务器上创建一个新项目
3). 以镜像推送的方式上传代码到 新的 服务器上
cd test.git
git push --mirror git@gitcafe.com/username/test.git
4). 删除本地代码
cd ..
rm -rf test.git
5). 到新服务器上找到 Clone 地址,直接 Clone 到本地
git clone git@gitcafe.com/username/test.git
注: 这种方式可以保留原版本库中的所有内容
本文介绍了一种通过克隆裸版本库、镜像推送代码至新服务器、并最终将代码克隆到本地的方法来迁移Git仓库的过程。该方法能完整保留原版本库的所有历史记录。
1458

被折叠的 条评论
为什么被折叠?



