Git check compare is slow

74 Views Asked by At

I am currently working on a project that has a directory with a lot of small files within it that don't change. I know that I can add it to the git ignore but I still want them in my repo. Will zipping the directory shorten the time it takes to pull/merge and if so are there any other ways to shorten the process?

1

There are 1 best solutions below

2
On BEST ANSWER

Git is fast enough.

If you want them in your repository - you will have to add, commit and push them once. If they don't change, they will never again be transferred and will NOT influence the pull and, moreover, merge time.

It is because git stores snapshots of files and not their diffs.

enter image description here

Say, you've got a file. It has sha1 of abcdef123456. Imagine a conversation between local and remote repos:

First push:
Local: "I've got abcdef123456 here!"
Remote: "Please transfer it to me"

Next pushes Local: "I've got abcdef123456 here!"
Remote: "Heh, that's boring. I've got it already."