git fetch

The command that downloads new commits and refs from a remote and updates your remote-tracking branches, without changing your own branches or files.

In more detail

After git fetch, git status can say you are behind, and git log origin/main shows the new commits, but your working tree and local branches are exactly as they were. It is always safe to run.

Example

git fetch

Related terms

Taught in

References