How to fix remote: error: quota exceeded for repository in Git

GitINTERMEDIATEHIGHUpdated Dec 2, 2025ยท 323 views

Git server rejects your push because the repository or namespace has exceeded its storage quota limit. This commonly occurs on platforms like GitHub, GitLab, and Bitbucket when repositories grow too large or contain oversized files.

Quick fix

Fixes remote: error: quota exceeded for repository

# Check your repository size locally
git count-objects -vH

# Find large files in history using git-sizer (install from GitHub)
git-sizer --verbose

# Find large files currently tracked
git ls-files | xargs ls -lh | sort -k5 -hr | head -20
  1. Check repository size and identify large files
  2. Update .gitignore to prevent large files
  3. Use Git LFS for large files
  4. Remove large files from Git history
git โ€” error
# Check your repository size locally
git count-objects -vH
# Find large files in history using git-sizer (install from GitHub)
git-sizer --verbose
# Find large files currently tracked
git ls-files | xargs ls -lh | sort -k5 -hr | head -20
remote: error: quota exceeded for repository

What this error means

This error occurs when you attempt to push changes to a Git server (GitHub, GitLab, Bitbucket, or self-hosted) and the repository or namespace has exceeded the maximum allowed storage quota. The server enforces these limits to ensure fair resource usage and maintain performance across all users. Storage quotas can be exceeded in several ways: the repository itself may be too large (often from accumulated history of large files), Git LFS (Large File Storage) data may exceed quota limits, or on platforms like GitLab, the entire namespace (group or user account) may be over its allocated storage. Unlike local disk space errors, this is a server-side enforcement - your local repository may be fine, but the remote server refuses the push to protect its storage infrastructure. The error typically appears during `git push` operations and prevents any new commits or changes from being uploaded until the quota issue is resolved.

Typical symptoms

  • Push operations fail with quota exceeded or size limit error messages
  • Error message specifically mentions repository or namespace storage limits
  • Pull and fetch operations may still work, but pushes are blocked
  • On GitHub: pushed commits exceed the repository size limit or LFS data quota warnings
  • On GitLab: this repository has exceeded its size limit or namespace storage limit messages
  • On Bitbucket: repository is over the size limit (4 GB) error
  • CI/CD pipelines fail at the push stage due to quota restrictions

Common causes

  1. Repository size exceeds platform limits (GitHub: 5GB recommended, GitLab: varies by plan, Bitbucket: 4GB hard limit)
  2. Git LFS data usage exceeds free tier quota (GitHub provides 1GB free LFS storage)
  3. Large binary files committed directly to Git history instead of using LFS
  4. Accumulated history of deleted large files still stored in Git history
  5. Build artifacts, logs, or vendor directories accidentally committed
  6. On GitLab: entire namespace (group) storage quota exceeded across all projects
  7. Self-hosted servers with administrator-configured disk quotas per user
  8. Inode limits exceeded on server filesystem (too many small files)

How to fix "remote: error: quota exceeded for repository"

1Check repository size and identify large files

First, analyze your repository to understand what is consuming space:

bash
# Check your repository size locally
git count-objects -vH

# Find large files in history using git-sizer (install from GitHub)
git-sizer --verbose

# Find large files currently tracked
git ls-files | xargs ls -lh | sort -k5 -hr | head -20

On GitHub, check your LFS quota at: https://github.com/settings/billing/summary

On GitLab, navigate to Settings > Usage Quotas to see storage breakdown.

On Bitbucket, check repository size from Settings > Repository details.

2Update .gitignore to prevent large files

Prevent future quota issues by ensuring large files are ignored:

bash
# Add common large file patterns to .gitignore
echo "*.log" >> .gitignore
echo "*.zip" >> .gitignore
echo "*.tar.gz" >> .gitignore
echo "node_modules/" >> .gitignore
echo "vendor/" >> .gitignore
echo "build/" >> .gitignore
echo "dist/" >> .gitignore
echo ".DS_Store" >> .gitignore

# Commit the .gitignore changes
git add .gitignore
git commit -m "Update .gitignore to exclude large files"

However, this only prevents future commits - existing large files in history must be removed separately.

3Use Git LFS for large files

If your project legitimately needs large files, use Git LFS to store them outside the main repository:

bash
# Install Git LFS (if not already installed)
# On macOS: brew install git-lfs
# On Ubuntu: sudo apt-get install git-lfs
# On Windows: download from https://git-lfs.com

# Initialize Git LFS
git lfs install

# Track specific file types with LFS
git lfs track "*.psd"
git lfs track "*.mp4"
git lfs track "*.zip"

# Commit the LFS configuration
git add .gitattributes
git commit -m "Configure Git LFS for large files"

# Migrate existing files to LFS (see advanced notes)

Note: Git LFS has its own quota limits, so check your platform's LFS pricing.

4Remove large files from Git history

To permanently reduce repository size, remove large files from all commits using git-filter-repo:

bash
# Install git-filter-repo
# On macOS: brew install git-filter-repo
# On Ubuntu: pip install git-filter-repo

# Create a backup first!
git clone --mirror <your-repo-url> backup-repo.git

# Remove specific large file from all history
git filter-repo --path path/to/large-file.zip --invert-paths

# Or remove all files matching a pattern
git filter-repo --path-glob '*.iso' --invert-paths

# Force push the cleaned history
git push origin --force --all
git push origin --force --tags

WARNING: This rewrites Git history. All team members must re-clone the repository after this operation.

5Run garbage collection to reclaim space

After removing files from history, reclaim space locally and on the server:

bash
# Run garbage collection locally
git gc --aggressive --prune=now

# Verify the new repository size
git count-objects -vH

# Push the changes (may require force push)
git push origin --force --all

# On some platforms, contact support to trigger server-side GC
# GitHub: Server GC happens automatically
# GitLab: May require manual trigger or support request
# Bitbucket: Enable Delete dangling commits feature

Note: Server-side garbage collection may take time to reflect in your quota.

6Upgrade storage quota or split the repository

If the repository legitimately needs more space:

Upgrade your plan:
- GitHub: Purchase additional LFS data packs or GitHub Pro/Team/Enterprise
- GitLab: Upgrade to Premium/Ultimate or purchase additional storage
- Bitbucket: Contact support if near the 4GB limit

Split the repository:

bash
# Option 1: Extract subdirectory to new repo with git filter-repo
git clone <original-repo> new-repo
cd new-repo
git filter-repo --path path/to/subproject/ --refs refs/heads/main

# Option 2: Use git submodules to link multiple repos
git submodule add <url-to-extracted-repo> path/to/submodule

Consider splitting monolithic repositories into focused projects with their own lifecycles.

Advanced notes

Migrating existing files to Git LFS:

To convert files already in Git history to LFS without losing history:

bash
# Install git-lfs-migrate extension
git lfs migrate import --include="*.psd,*.mp4" --everything
git push origin --force --all

Platform-specific quota details:

- GitHub: Repositories should be under 1GB ideally, 5GB strongly recommended. Individual files over 100MB are blocked. LFS provides 1GB storage and 1GB bandwidth per month free.
- GitLab: Namespace storage limits vary by plan. Free tier has 10GB per namespace. The entire group's storage counts toward the quota, not just individual projects.
- Bitbucket Cloud: Hard 4GB repository limit. Push size limit of 3.5GB per operation. LFS uploads use media API and don't count toward push size limits.
- Azure DevOps: Recommends keeping repositories under 10GB for performance. Hard limit at 250GB.

Coordinating history rewrites with teams:

When using git filter-repo or BFG Repo-Cleaner, commit SHAs change. Notify all team members to:

bash
# Save local work
git stash save "Before history rewrite"

# Fetch the rewritten history
git fetch origin
git reset --hard origin/main

# Restore local work
git stash pop

Using BFG Repo-Cleaner as an alternative:

BFG is faster and simpler for common cleanup tasks:

bash
# Download BFG jar from https://rtyley.github.io/bfg-repo-cleaner/
# Remove all files larger than 100MB
java -jar bfg.jar --strip-blobs-bigger-than 100M my-repo.git

# Remove specific files
java -jar bfg.jar --delete-files {filename} my-repo.git

cd my-repo.git
git reflog expire --expire=now --all && git gc --prune=now --aggressive

Self-hosted Git servers:

If running your own Git server with disk quotas:

bash
# Check quota on Linux
quota -v

# Request quota increase from administrator
# Or free up space in your user directory

For inode limits (too many small files), consolidate or delete unnecessary files before investigating disk quota.

Frequently asked questions

What does "remote: error: quota exceeded for repository" mean?
This error occurs when you attempt to push changes to a Git server (GitHub, GitLab, Bitbucket, or self-hosted) and the repository or namespace has exceeded the maximum allowed storage quota. The server enforces these limits to ensure fair resource usage and maintain performance across all users. Storage quotas can be exceeded in several ways: the repository itself may be too large (often from accumulated history of large files), Git LFS (Large File Storage) data may exceed quota limits, or on platforms like GitLab, the entire namespace (group or user account) may be over its allocated storage.
How do I fix "remote: error: quota exceeded for repository"?
Git server rejects your push because the repository or namespace has exceeded its storage quota limit. This commonly occurs on platforms like GitHub, GitLab, and Bitbucket when repositories grow too large or contain oversized files.
What causes "remote: error: quota exceeded for repository"?
Repository size exceeds platform limits (GitHub: 5GB recommended, GitLab: varies by plan, Bitbucket: 4GB hard limit) Git LFS data usage exceeds free tier quota (GitHub provides 1GB free LFS storage) Large binary files committed directly to Git history instead of using LFS
Is the "remote: error: quota exceeded for repository" error serious?
Yes. This is a high-severity error that usually blocks work until it is fixed, but the steps above resolve it.

Official resources & further reading