方式一
从原地址克隆一份裸版本库,比如原本托管于 GitHub,或者是本地的私有仓库
git clone --bare git://192.168.10.XX/git_repo/project_name.git
以镜像推送的方式上传代码到 新服务器上。
请确保已经添加了公钥到新的机器上
cd project_name.git
git push --mirror git@192.168.20.XX/path/to/path/new_project_name.git
方式二
假设你的remote是origin,用git remote set_url 更换地址
git remote set-url origin remote_git_address
然后用 git push 进行提交
git push
不过这种只会迁移当前分支到新的git上
其他
版权声明:本文为EthanCo原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。