Aditya Pavan
Aditya Pavan

Reputation: 17

Not able to push to GIT repository programmatically if the file size is more than 26 MB

Not able to push to GIT repository programmatically if the file size is more than 26 MB.

The maximum request size of 26214400 bytes was exceeded. GIT push is not working when file size is more than 26 MB. throwing exception at these lines of c# code error throwing at the line of code

Upvotes: 1

Views: 2398

Answers (2)

wallezzi
wallezzi

Reputation: 359

If you want to push larger file to Azure Repos and then encounter this issue, please check if this repository has set Maximum file size, as below. enter image description here If it is set, you can use Azure CLI to configure Case enforcement and Maximum file size policies by following this doc: View and edit repository settings.

In addition, if you have large, undiffable files in your repo such as binaries, you will keep a full copy of that file in your repo every time you commit a change to the file. Please use Git LFS to manage it. See: Manage and store large files in Git for details.

BTW, if you push files to GitHub, files that you add to a repository via a browser are limited to 25 MB per file. You can add larger files, up to 100 MB each, via the command line. See: https://stackoverflow.com/a/61041078/14886002 for details.

Upvotes: 2

anatolhiman
anatolhiman

Reputation: 1859

GIT itself doesn't have any file size limit, but doesn't handle large binaries very well. You will keep a full copy of all versions of a file you commit a change to, so large files will eventually make your repo very sluggish.

Repository providers do have limits, however. I'm not sure what the Azure limit is.

Here you will find more info about large files from Azure, where they recommend Git Large File Storage (LFS).

The error message you get is identical to the one thrown by Visual Studio Team Service a few years ago, maybe this is relevant for your case.

Upvotes: 1

Related Questions