How to fix fatal: Server does not support deepen in Git
This error occurs when attempting to deepen a shallow clone with git fetch --deepen on a Git server that lacks protocol support for the deepen capability. The deepen feature requires Git protocol version 2 support on the remote server.
Quick fix
Fixes fatal: Server does not support deepen
# Check if the server advertises protocol v2
GIT_TRACE_PACKET=1 git ls-remote origin 2>&1 | grep "version 2"
# Or check server capabilities
git ls-remote --symref origin HEAD- Check remote server Git version
- Use --depth instead of --deepen
- Convert to full clone with --unshallow
- Use --shallow-since for date-based deepening
# Check if the server advertises protocol v2GIT_TRACE_PACKET=1 git ls-remote origin 2>&1 | grep "version 2"# Or check server capabilitiesgit ls-remote --symref origin HEADfatal: Server does not support deepen
What this error means
This error indicates that the remote Git server does not support the "deepen" capability in the Git protocol. The --deepen option allows you to incrementally add more history to a shallow clone by specifying how many additional commits to fetch from the current shallow boundary, rather than from the branch tip. The deepen capability was introduced in Git protocol version 2 and requires server-side support. Older Git server versions (pre-2.19), certain Git hosting providers with legacy infrastructure, or servers that have disabled protocol v2 will reject fetch requests with the --deepen flag. This is particularly common in CI/CD environments where shallow clones are used to speed up builds, and subsequent operations try to deepen the history to access older commits for operations like rebasing or viewing full diffs.
Typical symptoms
- Git fetch fails with "fatal: Server does not support deepen"
- Unable to incrementally deepen a shallow clone
- CI pipeline fails when trying to fetch additional history
- Works with --depth but fails with --deepen on the same repository
- Error occurs after initial shallow clone when trying to access older commits
Common causes
- Remote Git server is running an older version (pre-2.19) that lacks deepen protocol support
- Git hosting provider has disabled or does not support Git protocol version 2
- Server administrator has explicitly disabled the deepen capability for security or performance reasons
- Using a Git client with protocol v2 against a server that only supports protocol v0/v1
- Corporate firewall or proxy is stripping protocol v2 capabilities from Git requests
How to fix "fatal: Server does not support deepen"
First, verify what Git version the remote server is running to confirm if it supports protocol v2:
# Check if the server advertises protocol v2
GIT_TRACE_PACKET=1 git ls-remote origin 2>&1 | grep "version 2"
# Or check server capabilities
git ls-remote --symref origin HEADIf you don't see protocol v2 advertised, the server doesn't support --deepen.
Replace --deepen with --depth to specify an absolute depth from the branch tip:
# Instead of this (which requires deepen support):
git fetch --deepen=100
# Use this (works with all Git servers):
git fetch --depth=200 # Adjust to total desired depthNote that --depth counts from the branch tip, so if your shallow clone has depth 100 and you want 100 more commits, use --depth=200.
If you need the complete history, convert the shallow clone to a full clone:
# Fetch all history and convert to full clone
git fetch --unshallow
# Verify the repository is no longer shallow
git rev-parse --is-shallow-repository # Should output "false"This fetches all remaining history and removes the shallow boundary entirely. This works with all Git server versions.
As an alternative to --deepen, fetch history back to a specific date:
# Fetch all commits since a specific date
git fetch --shallow-since="2024-01-01"
# Or fetch commits from the last 90 days
git fetch --shallow-since="90 days ago"This provides more predictable results than --deepen and works on servers with protocol v2 support.
If you're encountering this in CI/CD, modify your pipeline configuration to avoid shallow clones:
# GitHub Actions
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Full clone, no shallow boundary
# GitLab CI
variables:
GIT_DEPTH: 0 # Disable shallow clone
# CircleCI (in .circleci/config.yml)
checkout:
post:
- git fetch --unshallow || trueWhile this increases clone time, it prevents all shallow-clone-related issues.
Advanced notes
Protocol Version Compatibility: Git protocol v2 (which added deepen support) was released in Git 2.18 (June 2018) and enabled by default in Git 2.19 (September 2018). Check your server's Git version with git --version on the server. Some hosting providers may run newer Git versions but disable protocol v2 for compatibility or performance reasons.
Iterative Deepening Strategy: If --deepen is unavailable and you need to incrementally add history without fetching everything, you can implement your own iterative deepening by checking the date of your oldest commit and using git fetch --depth=N with progressively larger values until you have sufficient history. This is less efficient than --deepen but works universally.
Partial Clone Alternative: For very large repositories, consider using partial clone instead of shallow clone: git clone --filter=blob:none <url>. This fetches all commits but delays downloading blobs until needed. Partial clones support all Git operations (unlike shallow clones) and work with all protocol versions.
Server-Side Configuration: If you control the Git server and want to enable deepen support, ensure Git 2.19+ is installed and protocol v2 is enabled. Add protocol.version=2 to the server's Git config or set the GIT_PROTOCOL environment variable on the server.
Frequently asked questions
- What does "fatal: Server does not support deepen" mean?
- This error indicates that the remote Git server does not support the "deepen" capability in the Git protocol. The --deepen option allows you to incrementally add more history to a shallow clone by specifying how many additional commits to fetch from the current shallow boundary, rather than from the branch tip. The deepen capability was introduced in Git protocol version 2 and requires server-side support.
- How do I fix "fatal: Server does not support deepen"?
- This error occurs when attempting to deepen a shallow clone with git fetch --deepen on a Git server that lacks protocol support for the deepen capability. The deepen feature requires Git protocol version 2 support on the remote server.
- What causes "fatal: Server does not support deepen"?
- Remote Git server is running an older version (pre-2.19) that lacks deepen protocol support Git hosting provider has disabled or does not support Git protocol version 2 Server administrator has explicitly disabled the deepen capability for security or performance reasons
- Is the "fatal: Server does not support deepen" error serious?
- It is a medium-severity error โ more of a blocker than a risk. The steps above resolve it.
Official resources & further reading
- ๐Git Official Documentation
- ๐
- ๐
- ๐
- ๐ฌ
- ๐ฌ