This error occurs when attempting to clone a repository with --shallow-since on a Git server that doesn't support this feature. The server either runs an older Git version or uses a "dumb" HTTP transport that lacks shallow clone capabilities.
The --shallow-since option was introduced in Git 2.16+ as part of protocol version 2, allowing you to create shallow clones that include only commits after a specific date. This is more flexible than --depth because it lets you specify "commits from the last 6 months" rather than "the last 100 commits." However, this feature requires both client and server support. When a Git server doesn't advertise the "deepen-since" capability in its protocol negotiation, clients cannot use --shallow-since. This commonly happens with older Git installations (pre-2.16), servers using "dumb" HTTP transport (which doesn't support any shallow operations), or certain managed Git hosting services that haven't enabled protocol v2 features. The error is a protocol-level rejection happening during the initial handshake, before any repository data is transferred. Git detects the missing capability early and fails fast rather than attempting a full clone.
The most reliable workaround is to use commit count-based shallow cloning, which has universal support:
# Instead of date-based shallow clone
git clone --depth=100 <repository-url>
# Or for more recent history
git clone --depth=50 <repository-url>This creates a shallow clone with the specified number of commits from each branch tip. While less precise than date-based cloning, it works on all Git servers.
Check what capabilities the remote server advertises:
# For HTTP/HTTPS repositories
git ls-remote --symref <repository-url>
# Check if protocol v2 is supported
GIT_TRACE_PACKET=1 git ls-remote <repository-url> 2>&1 | grep "version"If you see "version 2" in the trace output, the server supports protocol v2. If not, it's using the older protocol which may not support --shallow-since.
Some servers support shallow-since over SSH but not HTTPS due to transport configuration:
# Convert HTTPS URL to SSH
# Instead of: https://github.com/user/repo.git
git clone --shallow-since="2024-01-01" [email protected]:user/repo.git
# For other hosts
git clone --shallow-since="1 year ago" ssh://[email protected]/group/project.gitIf you need commits from a specific date but must use --depth, you can incrementally deepen:
# Start with shallow clone
git clone --depth=50 <repository-url>
cd <repository-name>
# Check the oldest commit date
git log --reverse --format="%ai" | head -1
# If the date is too recent, deepen the clone
git fetch --deepen=50
# Check again and repeat until you reach your target date
git log --reverse --format="%ai" | head -1This is more manual but achieves similar results to --shallow-since.
If disk space and bandwidth aren't major constraints, a full clone is the most compatible approach:
git clone <repository-url>For CI/CD environments where you only need recent commits, evaluate whether the time saved by shallow cloning justifies the complexity when server support is unreliable.
Protocol v2 brought significant improvements to Git's wire protocol, including server-side filtering (refs/for filtering), which reduces bandwidth for monorepos. The --shallow-since feature specifically uses the "deepen-since" command internally, which is equivalent to "git rev-list --max-age=<timestamp>" on the server side.
Date formats for --shallow-since are flexible: "2024-01-01", "1 week ago", "6 months", and ISO 8601 timestamps like "2024-12-03T15:12:47Z" all work. Git parses these using the same date parsing logic as git log --since.
For self-hosted Git servers, ensure you're running Git 2.16 or later and that protocol.version=2 is enabled in the server configuration. GitHub, GitLab, and Bitbucket Cloud all support protocol v2 by default as of 2019, but on-premises installations may need manual enablement.
In CI environments (GitHub Actions, GitLab CI, CircleCI), shallow cloning with --depth=1 is often the default for performance. If you encounter this error in CI, check if the repository is being accessed through a caching proxy or mirror that doesn't support newer protocol features.
warning: BOM detected in file, this may cause issues
UTF-8 Byte Order Mark (BOM) detected in file
fatal: Server does not support --shallow-exclude
Server does not support --shallow-exclude
warning: filtering out blobs larger than limit
Git partial clone filtering large blobs warning
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