Skip to main content

Sign in

Save your progress and access it from any device.

Or with email

Don't have an account?

Privacy policy

Git fetch: download without merging

git fetch downloads changes from the remote repository without touching your local code. You can inspect the changes before deciding what to do with them.

Safe

What is git fetch?

git fetch downloads changes from the remote repository without merging them into your local code. Unlike git pull, it doesn't modify your working directory.

It's like checking your tracking number without opening the package. You know what has arrived, but you decide when and how to integrate it.

Git fetch syntax

git fetch origin

Download everything from origin

git fetch origin main

Download only the main branch

git fetch --all

Download from all remotes

Git fetch in practice

Download changes, inspect then merge.

Basic fetch

Inspect then merge

git fetch vs git pull

git fetch

Downloads remote changes without merging them. Your local code stays intact.

Use when: you want to inspect before merging

git pull

Performs a fetch then a merge automatically. Faster but less control.

Use when: you want to update quickly

Common mistakes with git fetch

Thinking fetch updated your code

Fetch does not modify your local files. After a fetch, you still need to run git merge origin/main to integrate the changes.

Forgetting to merge after fetch

If you fetch but never merge, your local branch falls behind. Remember to merge regularly.

Confusing local and remote branches

After a fetch, origin/main is up to date but main (local) is not. These are two different references.

Part of the Git Remote & Collaboration guide

A

GitQuest is created by Anaïs (nouvelle fenêtre), web developer and head of education, specializing in tech training and digital accessibility.

Questions about git fetch

Explore remote workflows with GitQuest

Learn to navigate between local and remote through GitQuest challenges.

Start the investigations