Daniel Peñalba
Daniel Peñalba

Reputation: 31897

Why cannot add a large file to a Git repository

Why Git does not support committing very big files? I'm trying to add a 4Gb file and I get the following error:

C:\Users\danipen\gitrepos\vmstore>git add mybigfile.rar
fatal: Out of memory? mmap failed: No such file or directory

UPDATE: Seems that git has a problem handling big files.

Upvotes: 4

Views: 3298

Answers (2)

Leon
Leon

Reputation: 12491

Should large binary files be in the repository, my opinion is no.

But if you really need version control on binaries or assets consider something like git-fat, or git-lfs

Upvotes: 4

René Höhle
René Höhle

Reputation: 27325

The idea of Git is to track small files with code. So the suggestion is to include your source files and ignore very big files like static files.

if you include a 4GB file every people who clone the repo have to clone the whole 4GB. Thats not the right way.

Upvotes: 3

Related Questions