phacility/phabricator · error · DiffusionCommitHookRejectException

OVERSIZED FILE This repository

Error message

OVERSIZED FILE
This repository ("%s") is configured with a maximum individual file size limit, but you are pushing a change ("%s") which causes the size of a file ("%s") to exceed the limit. The commit makes the file %s bytes long, but the limit for this repository is %s bytes.

What it means

Error "OVERSIZED FILE This repository ("%s") is configured with a maximum individual file size limit, but you are pushing a change ("%s") which causes the size of a file ("%s") to exceed the limit. The commit makes the file %s bytes long, but the limit for this repository is %s bytes." thrown in phacility/phabricator.

Solutions

  1. Split the commit so each file stays under the per-file size limit
  2. Store the large asset with the Files application or Git LFS instead of in the repository
  3. Raise or disable the maximum file size limit in repository configuration
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/applications/diffusion/engine/DiffusionCommitHookEngine.php:1301 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of phacility/phabricator@5720a38cfe (2026-08-21). Data as JSON: /api/errors/667919f32b7b62f2. Report an issue: GitHub.

Appendix: source

Thrown at src/applications/diffusion/engine/DiffusionCommitHookEngine.php:1301

        if ($size <= $limit) {
          continue;
        }

        $message = pht(
          'OVERSIZED FILE'.
          "\n".
          'This repository ("%s") is configured with a maximum individual '.
          'file size limit, but you are pushing a change ("%s") which causes '.
          'the size of a file ("%s") to exceed the limit. The commit makes '.
          'the file %s bytes long, but the limit for this repository is '.
          '%s bytes.',
          $repository->getDisplayName(),
          $identifier,
          $path,
          new PhutilNumber($size),
          new PhutilNumber($limit));

        throw new DiffusionCommitHookRejectException($message);
      }
    }
  }

  private function rejectCommitsAffectingTooManyPaths(array $content_updates) {
    $repository = $this->getRepository();

    $limit = $repository->getTouchLimit();
    if (!$limit) {
      return;
    }

    foreach ($content_updates as $update) {
      $identifier = $update->getRefNew();

      $sizes = $this->getFileSizesForCommit($identifier);
      if (count($sizes) > $limit) {
        $message = pht(

View on GitHub (pinned to 5720a38cfe)