当开发者经 gitclone.com 中转clone github上的代码库时,gitclone.com 会对代码库进行mirror缓存,以后有开发者clone时,将直接从mirror缓存中获取数据,mirror将在每天夜间从 github.com 同步。特别需要注意的是,首先要设置git的超时参数,防止项目较大时,服务器端mirror时间过长导致git报504(超时)。
git config --global http.lowSpeedLimit 0
git config --global http.lowSpeedTime 999999
在原URL中嵌入 gitclone.com,如:
git clone https://**gitclone.com/**github.com/gogs/gogs
如果需要更新,可以用'git pull'(需要等 gitclone.com 上的mirror更新)。需要提交代码时,因为 gitclone.com 暂不支持提交,可将.git/config中的remote 'origin'项目改成原始的 github.com URL即可。
git config --global url
"https://gitclone.com/".insteadOf https://
然后正常clone即可,这个命令会修改**c:\users\用户名\.gitconfig**,linux的配置文件在~/.gitconfig内,如需提交代码,将这个文件中url配置还原。
使用https://gitclone.com/gogs/ 提供了代码库镜像功能。
程序发布在:https://github.com/git-cloner/gitcache/releases, 将下载的 cgit.exe 放到命令行可识别的文件夹下。命令如下:
cgit clone https://github.com/git-cloner/gitcache
cgit pull
如需提交,请将.git/config中的remote 'origin'项目改成原始的github.com URL即可。