How to fix fatal: unable to write sha1 file: Disk quota exceeded in Git

GitBEGINNERMEDIUMUpdated Dec 6, 2025Β· 216 views

This error occurs when Git cannot write object files because your user account has exceeded its disk quota. The fix involves either freeing up space within your quota, requesting a quota increase from your system administrator, or cleaning up Git-specific storage like old objects and large files.

Quick fix

Fixes EDQUOT

# Standard quota command (Linux)
quota -s

# Or with more detail
quota -v

# On some systems
repquota -u $USER
  1. Check your current disk quota usage
  2. Find large files and directories consuming space
  3. Clean up Git repository storage
  4. Remove unnecessary files and directories
git β€” error
# Standard quota command (Linux)
quota -s
# Or with more detail
quota -v
# On some systems
repquota -u $USER
fatal: unable to write sha1 file: Disk quota exceeded

What this error means

When Git stores data, it creates object files (blobs, trees, commits) in the `.git/objects` directory. Each object is stored as a file named by its SHA-1 hash. This error appears when the operating system refuses to create new files because your user account has exceeded its allocated disk quota. Disk quotas are limits imposed by system administrators on shared systems (university servers, web hosting, corporate networks) to prevent any single user from consuming all available disk space. Unlike "No space left on device" (which means the entire filesystem is full), "Disk quota exceeded" specifically means **your account's allocation is full**, even though the physical disk may have plenty of space remaining. This error commonly occurs during: - `git clone` of large repositories - `git fetch` or `git pull` with many new objects - `git commit` when adding large files - `git gc` (garbage collection) which may temporarily increase space usage before cleanup

Typical symptoms

  • Git clone fails partway through with 'Disk quota exceeded'
  • Git fetch or pull operations fail when receiving new objects
  • Git commit fails when creating new object files
  • Git operations that previously worked now fail consistently
  • The error mentions 'sha1 file' or '.git/objects'
  • Other programs also fail with disk quota errors
  • Running 'quota' command shows you're at or over your limit

Common causes

  1. User disk quota on shared system is exhausted (most common)
  2. Large repository clone consuming entire quota allocation
  3. Accumulated Git objects from many repositories over time
  4. Large files tracked in Git history consuming quota
  5. Git reflog and stale objects taking up space
  6. Home directory filled with non-Git files
  7. Quota set too low for development work
  8. CI/CD environment with restrictive per-job quotas

How to fix "fatal: unable to write sha1 file: Disk quota exceeded"

1Check your current disk quota usage

First, determine how much quota you have and how much you're using:

bash
# Standard quota command (Linux)
quota -s

# Or with more detail
quota -v

# On some systems
repquota -u $USER

Sample output:

bash
Disk quotas for user alice (uid 1001):
     Filesystem  blocks   quota   limit   grace   files   quota   limit
      /dev/sda1   4900M   5000M   5500M            15234   0       0

This shows you're using 4900MB of a 5000MB soft limit. If blocks used exceeds your quota, that's the problem.

2Find large files and directories consuming space

Identify what's using your quota:

bash
# Find largest directories in home
du -sh ~/* 2>/dev/null | sort -hr | head -20

# Find large files
find ~ -type f -size +10M -exec ls -lh {} \; 2>/dev/null | sort -k5 -hr | head -20

# Check Git repository sizes
find ~ -name ".git" -type d -exec du -sh {} \; 2>/dev/null | sort -hr

Pay attention to:
- .git directories (each repository's Git data)
- node_modules, vendor, or dependency directories
- Log files, cache directories
- Downloaded archives or binaries

3Clean up Git repository storage

Run Git maintenance commands to reclaim space:

bash
# Navigate to your repository
cd /path/to/repo

# Remove old reflog entries (keeps only recent history)
git reflog expire --expire=now --all

# Garbage collect unreachable objects
git gc --prune=now --aggressive

# Check the size before and after
du -sh .git

For multiple repositories, run on all of them:

bash
for repo in $(find ~ -name ".git" -type d); do
  echo "Cleaning $repo"
  git -C "$(dirname $repo)" gc --prune=now
done
4Remove unnecessary files and directories

Free up quota by removing files you don't need:

bash
# Clear package manager caches
npm cache clean --force
pip cache purge
yarn cache clean

# Remove old log files
find ~ -name "*.log" -mtime +30 -delete

# Clear temporary files
rm -rf ~/.cache/* /tmp/$USER-*

# Remove unused node_modules (be careful!)
find ~ -name "node_modules" -type d -prune -exec rm -rf {} \;

If you have repositories you no longer need, consider deleting them entirely or moving them to external storage.

5Use shallow clone for large repositories

If cloning a large repository exceeds your quota, use a shallow clone:

bash
# Clone only the latest commit
git clone --depth 1 https://github.com/user/repo.git

# Clone with limited history
git clone --depth 100 https://github.com/user/repo.git

# Clone only a specific branch
git clone --depth 1 --single-branch --branch main https://github.com/user/repo.git

To later get more history if needed:

bash
# Deepen the history gradually
git fetch --deepen=100

# Or convert to full clone (if you have space)
git fetch --unshallow
6Request a quota increase

If you legitimately need more space for development work, contact your system administrator:

Information to provide:
- Current quota and usage
- Why you need more space (specific repositories or projects)
- How much additional space you're requesting

Example request:
> I'm working on [project] which requires cloning [repository]. The repository is approximately 2GB. My current quota of 5GB is insufficient for this work along with my other projects. Could I request an increase to 10GB?

Alternative solutions they may suggest:
- Project-specific shared storage
- Temporary quota increase
- Moving large repositories to a different filesystem

7Clone to a different location without quota restrictions

If you have access to storage without quota limits, clone there instead:

bash
# Check available filesystems
df -h

# Clone to a shared or project directory (if available)
git clone https://github.com/user/repo.git /shared/projects/repo

# Or use /tmp for temporary work (WARNING: may be cleared on reboot)
git clone https://github.com/user/repo.git /tmp/repo

You can create a symlink from your home directory:

bash
ln -s /shared/projects/repo ~/repo

For CI/CD environments, configure the workspace to use a directory with sufficient space limits.

Advanced notes

### Understanding Linux Disk Quotas

Linux supports two types of quotas:
- Block quota: Limits total disk space used (measured in 1KB blocks)
- Inode quota: Limits number of files/directories (each file uses one inode)

Git can hit either limitβ€”block quota from large files, or inode quota from many small object files.

bash
# Check both block and inode usage
quota -vs

### Soft vs Hard Limits

- Soft limit: Can be exceeded temporarily (grace period, usually 7 days)
- Hard limit: Absolute maximum, cannot be exceeded

When you're in the grace period after exceeding soft quota, you can still write files. Once the grace period expires or you hit the hard limit, all writes fail.

### Git Large File Storage (LFS)

If your repository contains large binary files, Git LFS can help by storing file contents on a remote server instead of in the local repository:

bash
# Install Git LFS
git lfs install

# Track large file types
git lfs track "*.psd"
git lfs track "*.zip"

# Verify tracking
cat .gitattributes

This moves large file storage to the LFS server, reducing local disk usage.

### Repository Maintenance Best Practices

For constrained environments, regularly maintain repositories:

bash
# Create a maintenance script
cat > ~/bin/git-cleanup.sh << 'EOF'
#!/bin/bash
for repo in $(find ~ -name ".git" -type d 2>/dev/null); do
  dir=$(dirname "$repo")
  echo "Cleaning $dir"
  git -C "$dir" reflog expire --expire=now --all
  git -C "$dir" gc --prune=now
done
EOF
chmod +x ~/bin/git-cleanup.sh

Run this weekly via cron to keep repositories compact.

### SSH Agent and Git Credential Issues

If you're using SSH keys stored on disk, ensure they're not unexpectedly large. Bloated ~/.ssh/known_hosts or many key files can contribute to quota usage:

bash
# Check SSH directory size
du -sh ~/.ssh

# Remove old known_hosts entries
ssh-keygen -R old-server.example.com

### CI/CD Pipeline Considerations

In CI environments with per-job disk limits:

yaml
# GitLab CI example - use shallow clones
variables:
  GIT_DEPTH: 10
  GIT_STRATEGY: fetch

# GitHub Actions - shallow checkout
- uses: actions/checkout@v4
  with:
    fetch-depth: 1

### Checking Filesystem vs Quota

If you're unsure whether it's a quota issue or the disk is actually full:

bash
# Check filesystem space (full disk)
df -h ~

# Check your quota (quota exceeded)
quota -s

If df shows space available but quota shows you're over limit, it's a quota issue. If df shows 100% used, the entire filesystem is full (a different problem).

Frequently asked questions

What does "EDQUOT" mean?
git/objects directory. Each object is stored as a file named by its SHA-1 hash. This error appears when the operating system refuses to create new files because your user account has exceeded its allocated disk quota.
How do I fix "EDQUOT"?
This error occurs when Git cannot write object files because your user account has exceeded its disk quota. The fix involves either freeing up space within your quota, requesting a quota increase from your system administrator, or cleaning up Git-specific storage like old objects and large files.
What causes "EDQUOT"?
User disk quota on shared system is exhausted (most common) Large repository clone consuming entire quota allocation Accumulated Git objects from many repositories over time
Is the "EDQUOT" error serious?
It is a medium-severity error β€” more of a blocker than a risk. The steps above resolve it.

Official resources & further reading