Git Cheatsheet - Quick Git Command Reference

Quick reference for common Git commands. Search, copy, and use Git commands instantly.

Share
Back to Git Cheatsheet

git fetch

Fetch updates from remote without merging

Syntax

git fetch [options] [<remote>] [<branch>]

Common Options

OptionDescription
--allFetch from all remotes
--prunePrune deleted remote branch refs
--tagsFetch all tags
--recurse-submodulesRecursively fetch submodules
--depth <n>Shallow fetch with depth
--no-tagsDo not fetch tags
-v, --verboseVerbose output

Examples

git fetch

Fetch default remote updates

git fetch origin

Fetch from specific remote

git fetch --prune

Fetch and prune remote refs

git fetch --all

Fetch from all remotes

Related Tools

More Code & Dev Tools