Your error message states that we should try increasing http.postBuffer
.
The git documentation for http.postBuffer
tells us that the default maximum is 1 MiB.
Maximum size in bytes of the buffer used by smart HTTP transports when POSTing data to the remote system. For requests larger than this buffer size, HTTP/1.1 and Transfer-Encoding: chunked is used to avoid creating a massive pack file locally. Default is 1 MiB, which is sufficient for most requests.
You're right to note that your images are numerous. Because you have 41627 new objects to push, the total size of the files you're writing is 2.25 GiB. This is far larger than the 1 MiB limit.
Increasing http.postBuffer
You could try increasing the buffer size, as the error message states.
You can increase this to 3 GiB by setting git config http.postBuffer 3221225472
.
I would recommend against doing this, because 3 GiB is much, much larger than the 1 MiB default.
Git Large File Storage
Storing large non-text-based files is a common problem with git, and a solution which exists is Git Large File Storage. It replaces your images in Git with pointers to files hosted on GitHub.com.
It offers the "same access controls and permissions" as when working with a remote host like GitHub.
Keep the same access controls and permissions for large files as the rest of your Git repository when working with a remote host like GitHub.
Generally, git isn't made for versioning binary files. It's best for tracking text-based content.