loostro loostro - 10 months ago 43
Git Question

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/JS/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 2 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 ofcourse,
git add
,
git commit
and
git push
to upstream)

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

I have two questions:


  • why this is happeing?

  • how can I fix my repository?



Note: I am the only one useing and pushing to this repo.

Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download