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.
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.
First, analyze your repository to understand what is consuming space:
# 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 -20On 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.
Prevent future quota issues by ensuring large files are ignored:
# 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.
If your project legitimately needs large files, use Git LFS to store them outside the main repository:
# 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.
To permanently reduce repository size, remove large files from all commits using git-filter-repo:
# 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 --tagsWARNING: This rewrites Git history. All team members must re-clone the repository after this operation.
After removing files from history, reclaim space locally and on the server:
# 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 featureNote: Server-side garbage collection may take time to reflect in your quota.
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:
# 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/submoduleConsider splitting monolithic repositories into focused projects with their own lifecycles.
Migrating existing files to Git LFS:
To convert files already in Git history to LFS without losing history:
# Install git-lfs-migrate extension
git lfs migrate import --include="*.psd,*.mp4" --everything
git push origin --force --allPlatform-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:
# 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 popUsing BFG Repo-Cleaner as an alternative:
BFG is faster and simpler for common cleanup tasks:
# 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 --aggressiveSelf-hosted Git servers:
If running your own Git server with disk quotas:
# Check quota on Linux
quota -v
# Request quota increase from administrator
# Or free up space in your user directoryFor inode limits (too many small files), consolidate or delete unnecessary files before investigating disk quota.
fatal: bad object in rev-list input
Git rev-list encounters bad or invalid object
fatal: Out of memory, malloc failed during pack operation
Out of memory during Git pack operation
kex_exchange_identification: Connection closed by remote host
Connection closed by remote host when connecting to Git server
fatal: unable to access: Proxy auto-configuration failed
How to fix 'Proxy auto-configuration failed' in Git
fatal: unable to access: Authentication failed (proxy requires basic auth)
How to fix 'Authentication failed (proxy requires basic auth)' in Git