Re:Speed Up Git Pull
by robin_reala on Thursday September 05, 2013 @12:27PM
(#6335084)
http://xkcd.com/1205/
If you pull 10 times a day (conservative for me) then you’ll save ~5 hours over a year.
But couldn't it very well take more than 5 hours to set this up?
Doesn't matter too much. A short wait can throw you out of focus, and it's the time you spend getting back into focus that's important.
More like 5 minutes to set it up.
It is when you need to dig into the documentation to figure all of this out, but if you now google 'speed up git pull', you'll find this article, repeat the commands, ?????, profit! five minutes.
It took me less than five seconds to make the SSH changes and less than five minutes to set up the intermediate server. Now I also have a cache for when GitHub goes down (all the time.)
> Now I also have a cache for when GitHub goes down (all the time.)
Isn't the `.git` a cache for when github goes down? Git keeps all of your history inside your repository; you don't need network access to do anything.
Sort of. I've automated synchronizing it with the GitHub repo, so my local repo may be behind the cached repo. I'm also protected if a repository is deleted/moved/DMCAed.
What benefits does this provide that a cron job running `git fetch` doesn't?
Redundancy, public access and not having hundreds of unused repositories on my computer. I'm not trying to sell anyone on the idea, it just works for me and I like it so whatever.
However, I wonder if this isn't treating a symptom versus a root cause.
Is saving that 5s round-trip so common in your workflow that you needed to optimize it, and would it be more productive to refactor the app so you and collaborators are working on different files?
Also, this has the entirely valuable guidance that pushing to a local server is much faster than a remote server. There's a Github Enterprise product, for you to run close to you. It'd be an interesting calculation to see the performance hit from waiting 5s to push to a remote server, versus the performance hit from keeping your nearby server up and patched.
But nice to read, kudos all the same!