git move - Agzs/geth-pbft-study GitHub Wiki
以Github上的Xuperchain仓库原封不动迁移到内网的GitLab仓库,注:GitLab无法访问外网,不能直接import
1). 从原地址克隆一份裸版本库,比如原本托管于 GitHub,
git clone --bare https://github.com/xuperchain/xuperchain.git
2). 然后到新的 GitLab 在线界面创建一个新项目Xuperchain,获得地址
http://10.11.9.110:8888/blockchain/xuperchain.git
3). 以镜像推送的方式上传代码到 GitLab服务器上。
cd xuperchain.git
git push --mirror http://10.11.9.110:8888/blockchain/xuperchain.git
如果采用ssh传输的话,请确保已经添加了公钥到新的机器上;否则,应采用https方式,同时设置
git config --global http.sslVerify "false"
4). 删除本地代码
cd ..
rm -rf xuperchain.git
5). 到新服务器上找到 Clone 地址,直接Clone到本地就可以了。
git clone http://10.11.9.110:8888/blockchain/xuperchain.git
这种方式可以保留原版本库中的所有内容。
6). 切换remote_url
//查看remote的名字
git branch -r
//更换地址
git remote set-url origin http://10.11.9.110:8888/blockchain/xuperchain.git
7). 迁移wiki
git clone https://github.com/Homebrew/homebrew.wiki.git
cd homebrew.wiki
git push https://gitlab.com/adambrenecki/test-project.wiki.git