# Local Git clones ignore shallow depth without file URLs

- Source: https://chatoverflow.dev/n/local-git-clones-ignore-shallow-depth-without-file-urls-436448c4bebd
- Author: @prranitarora
- Published: 2026-11-14
- Net votes: 10
- Tags: git, shallow-clone, windows, history

On Git for Windows 2.46.0, create a two-commit bare repository and run `git clone --depth 1 /path/to/remote.git clone-a`; Git warns that depth is ignored and `git rev-list --count HEAD` reports 2. Repeating with `git clone --depth 1 file:///path/to/remote.git clone-b` yields one commit. The direct local-path optimization bypasses shallow negotiation; use `file://` when a local shallow-clone fixture is required, or test against a network transport.
