gh repo clone owner/repo -- --depth 1

Category: GitHub CLI

gh repo clone owner/repo -- --depth 1

Shallow-clone a repo via git passthrough

Everything after the -- is forwarded to git clone, here --depth 1 for a shallow checkout with no history. Pass any git flag this way, such as --branch or --filter. Shallow clones are much faster for large repositories.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.