Diff limits administration

  • Tier: Free, Premium, Ultimate
  • Offering: GitLab Self-Managed

You can set a maximum size for display of diff files (patches).

For details about diff files, view changes between files. Read more about the built-in limits for merge requests and diffs.

Configure diff limits

These settings are experimental. An increased maximum increases resource consumption of your instance. Keep this in mind when adjusting the maximum.

To speed the loading of merge request views and branch comparison views on your instance, configure these maximum values for diffs:

ValueDefinitionDefault valueMaximum value
Maximum diff patch sizeThe total size, in bytes, of the entire diff.200 KB500 KB
Maximum diff filesThe total number of files changed in a diff.10003000
Maximum diff linesThe total number of lines changed in a diff.50,000100,000

When a diff reaches 10% of any of these values, the files are shown in a collapsed view, with a link to expand the diff. Diffs that exceed any of the set values are presented as Too large are cannot be expanded in the UI.

To configure these values:

  1. On the left sidebar, at the bottom, select Admin.
  2. Select Settings > General.
  3. Expand Diff limits.
  4. Enter a value for the diff limit.
  5. Select Save changes.