Git项目转移

来源:互联网 发布:网络签约写手的收入 编辑:程序博客网 时间:2024/05/26 20:23

从git.oschina.net上将工程转移公司内部git

1.在自己公司新建git工程。
2.打开终端命令行
3.将旧的工程clone到本地,包括clone历史记录

git clone --bare https://git.oschina.net/xxxx.git.

如果出现:

remote: Counting objects: 20572, done.
remote: Compressing objects: 100% (10586/10586), done.
error: RPC failed; curl 56 SSLRead() return error -9806iB/s        
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed

则更改为: git clone --bare git@git.oschina.net:xxxx/yyyyy.git

4.cd xxxx.git

5.如果工程较大,配置 git config http.postBuffer 524288000, 否则后面上传的时候会报错

error: unable to rewind rpc post data - try increasing http.postBuffer
error: RPC failed; curl 56 Recv failure: Operation timed out


6.将工程push到新工程地址

git push --mirror http://ldgit.xxxxx.com/xxxxxx.git



参考:https://help.github.com/articles/duplicating-a-repository/#mirroring-a-repository

原创粉丝点击