How to cache github repositories, so the second git clone will use cache instead of github repo

Senario:

1) we are located in China, so github access is slow and sometimes impossible, and, as you know, we cannot live without github.

2) when developing iOS projects, we use Cocoapods, and it uses many github repositories, so when installing containers, a lot of commands are launched like git clone git@github.com/reactivecocoa/ReactiveCocoa.

so can this process be improved? the best solution for me seems to create a local cache of these github repositories on startup git clone git@github.com/reactivecocoa/ReactiveCocoa, which actually starts git clone http://192.168.1.199/repos/reactivecocoa/ReactiveCocoa, and the server can determine if any code exists, if so, return the cached file, otherwise make a github request and cache the result.

but can't find a workable strategy to achieve this, any suggestions?

+4
source share
1 answer
git config --global url."git@github.com:reactivecocoa/ReactiveCocoa".insteadOf "http://192.168.1.199/repos/reactivecocoa/ReactiveCocoa"
+3
source

All Articles