git fetch

Download latest commits and branch info from remote without auto-merging into local branches

Syntax

git fetch [<remote>] [<refspec>...]

Parameters

ParametersDescriptionExamplesLevel
--all New Common
--prune Common
--tags Common
--depth <n> () Common
--dry-run , Common

Examples

origin New

git fetch origin

New

git fetch --all

New

git fetch --prune

main New

git fetch origin main

fork

git fetch upstream && git merge upstream/main

Tips

Related Commands