Git pull is very slow... Why?
I tried all solutions in this thread with no luck. I tried using git protocol 2 at the suggestion of a coworker, which ended up being very effective (went from waiting 3 minutes for pulls/pushes to start to a few seconds)
git config --global protocol.version 2
The problem was in EmberJS
app directory. It contained node_modules
and bower_components
directories which kept third-party libraries used by GruntJS
to build my JS and CSS assets.
Each of these contained many files and directories.. considering that the dependency tree contained hundreds of libraries of size varying from small (few files) to big fat (many files).
After removing these directories and ignoring them, the git repository works fast again.
I had the same issue. For me this was a IPv4/IPv6 issue. I fixed it forcing SSH to use IPv4.
Set "AddressFamily inet" in /etc/ssh/ssh_config to force IPv4 connection. Then restart ssh client sudo service ssh restart
More info here.
I have had the same issue when I was dealing with thousands of small files. The thing that fixed it for me was to set the postbuffer in git repo's config
git config http.postBuffer 524288000
Instead of uploading with 18KB/s it suddenly went the full bandwidth