glimfly
git updated

Git clone vs pull vs fetch: which one do you need?

In one sentence:Git clone downloads a full copy of a repository the first time you get it, git fetch checks the remote for new commits without touching your files, and git pull fetches those commits and merges them straight into your current branch.

What it actually is

Clone, fetch and pull are three different-sized bites of the same job: getting a project’s history from a remote repository onto your machine. Clone is the one-time move. It downloads the entire repository, every commit, every branch, the whole .git history, into a brand new folder, and sets up a connection back to where it came from, called origin. You run it once, at the very start of working on a project.

Fetch and pull are what you do afterward, once you already have the project locally and want to check whether anything changed on the remote (a teammate pushed, or your agent pushed from another machine). Fetch downloads whatever is new, commits and branches, but doesn’t touch a single file in your working folder. It just updates Git’s internal record of what the remote currently looks like. Pull does that same download, then immediately merges those new commits into the branch you’re currently on.

Think of it like moving house and getting mail. Clone is moving in and having the postal service register your new address, from now on everything sent there lands with you. Fetch is walking out to the mailbox and looking at what arrived without opening anything. Pull is checking the mailbox and bringing the new mail straight to your desk.

Why your AI just did this

When your agent runs git clone <url>, it’s setting up a project for the first time, either yours or one you asked it to check out. That should only need to happen once per project, on a given machine.

After that, it reaches for fetch when it wants to know whether the remote has moved before deciding what to do next, for example checking origin/main before opening a pull request, without changing anything in your working folder. It reaches for pull when it actually wants those remote changes folded into your branch right now, usually before starting new work, so it isn’t building on top of a copy of main that’s already out of date.

A careful agent tends to fetch before it merges or rebases, so it can show you what’s incoming before it touches your files. If you see it pause to describe changes on the remote instead of just applying them, that’s what it’s doing.

When you’ll run into it

  • git pull reports “Already up to date.” There was nothing new on the remote to fetch or merge.
  • Your agent says “Let me fetch first to see what changed on origin/main” before it merges or rebases anything.
  • git pull fails with “Your local changes would be overwritten by merge,” meaning you have uncommitted edits pull would clobber. Commit or stash them first.
  • A pull creates a merge conflict because someone else’s commits and your own touch the same lines (see merge conflict).
  • Cloning fails with “fatal: repository not found,” usually a wrong URL, a private repo you don’t have access to, or missing authentication.

What to check

  • Run git remote -v right after a clone to confirm origin points where you expect
  • Run git status before a pull. Uncommitted changes are the most common reason a pull fails or behaves strangely
  • If you only want to look, not merge, run git fetch then git log origin/main or git diff main origin/main to see what’s incoming first
  • Confirm which branch you’re actually on with git branch before pulling. Pull only updates the branch you’re currently checked out on
  • If a clone is slow on a big, old repository, ask whether you actually need full history, git clone --depth 1 grabs just the latest snapshot

Say it like a dev

Instead of: “download the project” Say: “clone the repo”

Instead of: “check if there’s anything new” Say: “fetch from origin and show me what changed before you merge”

Instead of: “just grab whatever’s new and put it in” Say: “pull the latest from main”

People actually ask

“So what is git clone actually downloading? A tarball?”

More like a full copy of the repository's Git history: every commit, every branch, the complete .git folder, dropped into a brand new folder on your machine. That's also why cloning an old project can take a while, and why git clone --depth 1 exists, to grab just the latest snapshot when you don't need years of history.

“What's actually different between git pull and git fetch, if pull does fetch anyway?”

Fetch downloads whatever is new on the remote and stops there. Your files and your current branch stay exactly as they were. Pull does that same download, then immediately merges the new commits into whichever branch you're on. Use fetch when you want to see what changed first, use pull when you're ready to bring it in right now.

“Does git pull always merge, or can it do something else?”

By default, yes, pull merges the fetched commits into your branch, which can add an extra merge commit to your history. Plenty of teams set it to rebase instead, so your local commits get replayed on top of the fetched ones for a straighter history. Either way pull always changes your current branch, and fetch never does.

Related terms

Glim can explain your sessions, live.

The app watches your coding agent and narrates it in plain words. Waitlist is open.

Join the waitlist