git clone --single-branch --branch v5.1.0 https://github.com/expressjs/express.git

Category: Git - Core

git clone --single-branch --branch v5.1.0 https://github.com/expressjs/express.git

Clone only a single branch of a repository

The --single-branch flag fetches just the named branch instead of every branch and tag. Pair it with --branch to pin the checkout to a specific branch or tag, like a release line. It is handy for CI jobs and for exploring one version without downloading everything.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.