Why can't Git handle large files and large repos?

后端 未结 3 680
情深已故
情深已故 2020-12-15 09:54

Dozens of questions and answers on SO and elsewhere emphasize that Git can\'t handle large files or large repos. A handful of workarounds are suggested such as git-fat and g

3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-15 10:01

    It's not true that git "can't handle" large files. It's just that you probably don't want to use git to manage a repository of large binary files, because a git repo contains the complete history of every file, and delta compression is much less effective on most kinds of binary files than it is on text files. The result is a very large repo that takes a long time to clone, uses a lot of disk space, and might be unacceptably slow for other operations because of the sheer amount of data it has to go through.

    Alternatives and add-ons like git-annex store the revisions of large binary files separately, in a way that breaks git's usual assumption of having every previous state of the repository available offline at any time, but avoids having to ship such large amounts of data.

提交回复
热议问题