git - local cache for a github repository? -
we use github manage great deal of our software environment, , wager many other orgs overwhelming majority of traffic to/from repo comes our office. in mind, there way build local cache of given github repository, still have protection of cloud version? i'm thinking of in model of caching proxy server, local server (presumably in our building, on our local network) handle vast majority of cloning/pull operations.
this seems should doable, searching has been difficult, think in no small part because words "local" , "cache" have overloaded meanings git(hub) questions.
your latest comment makes clear you're looking performance optimization. helps.
you can start creating local mirror of github repository following these instructions. can either periodically update it, or arrange receive web hooks github update local mirror "on demand". need set small web service respond hooks github. can add web hook going https://github.com/someuser/someproject/settings/hooks/new. want select "let me select individual events" radio button, , select:
- delete
- push
- create
this keep cache up-to-date respect changes in available tags , branches.
set git server makes repository available locally. can simple running git daemon
, or local account accessible via ssh, or more full featured, depending on local requirements.
then set local working copies this:
$ git clone http://localrepository/someproject.git $ cd someproject $ git remote set-url --push http://github.com/someuser/someproject.git
this set each repository pull local cache, push changes upstream github.
Comments
Post a Comment