Speed Up Git Pull
interrobeng.com
interrobeng.com
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!
If you pull 10 times a day (conservative for me) then you’ll save ~5 hours over a year.
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.
[1] http://www.anchor.com.au/blog/2010/02/ssh-controlmaster-the-...
I usually set ControlPersist to 30 seconds, which may not be long enough for people hoping to get performance improvements from GitHub, . Setting it to too large a value increases the risk that you'll have stale server sockets after a network outage.
Best part of reading this article. I had turned off connection sharing because of this.
So what, in more details, are the downsides to ControlPersist?
ssh> help
Commands:
-L[bind_address:]port:host:hostport Request local forward
-R[bind_address:]port:host:hostport Request remote forward
-D[bind_address:]port Request dynamic forward
-KR[bind_address:]port Cancel remote forward
(If you're not familiar with them, some of the other escape sequences are useful too. ~? lists them all.)[EDIT] Apparently, if you have a recent enough version, you can add a forward to the master with `ssh -O forward ...` [1]
[1] http://serverfault.com/questions/237688/adding-port-forwardi...
Host github.com
ControlMaster auto
ControlPath /tmp/%r@%h:%p
ControlPersist yesI believe this is what ControlPersist is meant to solve - it may not have existed when that blog post was written.
(ssh -fqN -o "StrictHostKeyChecking no" git@bitbucket.org >&/dev/null &)
with bitbucket and github in my zshrc and bitbucket stays open but github is getting closed at some point. It used to stay open however.> Establishing an SSH connection every time you perform a Git operation costs many round-trips
I don't really understand why the author is saying this. The whole point of git is to be distributed and not to push/pull at each commit.
That being said, he found something that speeds up his workflow tremendously, so congratulations.
Centos 6 ships with a patched version of 5.3.
I used this setup for almost a year. It saved me lot of time and sanity.
Example: $5 digital ocean droplet (comes without swap, but it's over SSD, so you can create a swap file, and is less painful than mechanical swap).
Surely if they do, they won't for too long if lots of people start doing this.
Please setup local ssh termination to your network.
Thanks,
Alex
git merge origin/master
A much preferred workflow.