gitversion-controlrepository

Git pull is very slow... Why?


Note I have studied the Git-is-very-very-slow question, but in their case the reason was big binary files, while in my repository there is PHP/JavaScript/HTML/CSS only code (no binaries) and the biggest file in the repository is around 800 KB.

I've changed one file (a few lines), then git add . and git commit -m "msg", then git push origin master.

On some other machine, when I do git pull origin master it downloads a few MiB of data, and it takes more than two minutes to calculate the delta and apply changes. Something is terribly wrong here.

I suspect some recent operations may cause this:

Recently, I've accidentally added many vendor assets (bower_components assets) when I realized it, I've used git rm to remove them from repository (and of course, git add, git commit and git push to upstream).

That was a few days ago and the problems I have right now started happening around that time.

I have two questions:

Note: I am the only one using and pushing to this repository.


Solution

  • The problem was in EmberJS application directory. It contained node_modules folder and bower_components directories which kept third-party libraries used by Grunt to build my JavaScript 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.