1

I'm working on a git repo where we have 11mb .zip file which has 4 folder and rar file packages under that. Now I have made some changes into xml file which is one of the folder in Repo.

While pushing to my branch I'm getting this error. "The object is 11952050 byte, which is greater than the 10485760 byte limit for objects in this repository”. I want to know how I can push my changes to that .zip file to the Repo. I have to make change only in 1 file and 1 liner change is required. I was referring this article which says don't commit binary files to git link one thing I know we can do via nuget package but I'm new into that don't know how to create and how its going to merge with my .zip file.

Can anyone suggest me how to achieve this ..?

Thanks

Gaurav Joshi
  • 861
  • 1
  • 11
  • 17
  • That's closer to 12 MB than 11 MB, but either way, that's not a very big file. *Git* has no problem with such files. "Big" files that cause heartache are, e.g., DVD images (4.7 GB). Still, the advice not to store large binaries is generally good. If you can unpack each binary package into a set of individual files, that would make more sense in version control; or, if the files are just to be taken as-is, you could store them outside Git entirely. – torek Feb 14 '21 at 01:35
  • Note that while XML files are often text, merging XML data is a specialized operation that Git is *very bad at*. It's probably unwise to store XML files in Git, unless they too are just to be taken as-is, and never merged by Git itself. (But people do store XML in Git. Just look for the cries for help here on StackOverflow, whenever Git mangles the XML data during merge. :-) ) – torek Feb 14 '21 at 01:36
  • @HughLin-MSFT I didn't see any proper answer of my questions. MorrowSolutions gave me one solution but its not feasible my administrator not allow me to increase the size from the project setting. Basically I have to modify one file under zip file at repo which I'm trying to figure it out. – Gaurav Joshi Feb 16 '21 at 02:33

2 Answers2

0

This is configurable within your project repository settings, under policies.

To get there:

  • Head to your project that contains the repo getting the error message.
  • Select "Project Settings" in the bottom left.
  • Select "Repositories"
  • Choose the "Policies" tab
  • Bump up the "Maximum File Size" policy

enter image description here

Microsoft doesn't have much documentation on this setting, but what they have can be found here:

I'd also recommend against pushing a ZIP archive to git, they can't be diffed and could cause issues when multiple team members are pushing changes. You can find Microsoft's recommendations on how to handle large Zip Files here:

Max Morrow
  • 1,206
  • 4
  • 13
0

You can try to use Git Large File Storage (LFS).

Git LFS is an extension to Git which commits data describing the large files in a commit to your repo, and stores the binary file contents into separate remote storage. When you clone and switch branches in your repo, Git LFS downloads the correct version from that remote storage. Your local development tools will transparently work with the files as if they were committed directly to your repo.

Hugh Lin
  • 17,829
  • 2
  • 21
  • 25