I uploaded an HTML file to a GitHub repository two different ways: drag and drop and add/commit/push using Git on Terminal. In both cases I received the error that the file is too big to display, yet it is only 1.06 MB. I've searched the documentation on GitHub and here on SO. Any thoughts please?
Asked
Active
Viewed 8,775 times
1 Answers
6
This seems expected: GitHub will not show the content (or a diff) of a file larger than a certain size (over 1MB).
See nodejs/node issue 5533 and nodejs/node PR 6337 as an example.
How that file was added (drag and drop or regular push) will not change what is a server-side policy.
If, later on, one would need to see that file, you can:
- either extract it from the latest archive using git archive;
- a filtered clone (
git clone --filter
); - use a
sparse checkout
as I mentioned here; - use a shallow clone in order to limit the history (and size) of what you are importing;
- combine both a shallow and sparse clone;
Most of those advises derive from the work/articles done by Derrick Stolee from Microsoft:
- "Bring your monorepo down to size with sparse-checkout " (Jan. 2020)
- "Get up to speed with partial clone and shallow clone " (Dec. 2020)
- In a partial clone, some data is not served immediately and is delayed until the client needs it.
- Blobless clones skip blobs except those needed at checkout time.
- Treeless clones skip all trees in the history in favor of downloading a full copy of the trees needed for each checkout.
So if cloning the repo is what you need in order to see those files... you have options to do so in an economical way, without downloading too much.

VonC
- 1,262,500
- 529
- 4,410
- 5,250