---
title: "What is the difference between git pull and git fetch?"  
description: "What is the difference between git pull and git fetch?"  
author: "Shalini Passi"  
published: 2025-07-04  
updated: 2025-12-02  
canonical: https://www.mindstick.com/forum/161786/what-is-the-difference-between-git-pull-and-git-fetch  
category: "GitHub"  
tags: ["github", "git"]  
reading_time: 2 minutes  

---

# What is the difference between git pull and git fetch?

**What is the [difference](https://www.mindstick.com/articles/157114/good-news-or-bad-news-and-the-difference-is) between** `git pull` **and** `git fetch`**?**

## Replies

### Reply by Anubhav Sharma

## 1. `git fetch`

- Downloads **new commits, branches, and data** from the remote repository.
- **Does NOT change your local working files**.
- Just updates your **remote-tracking branches** (like `origin/main`).
- Lets you **see what’s changed** before merging.

### Example:

```plaintext
git fetch origin
```

After fetching, you can compare:

```plaintext
git diff main origin/main
```

**Safe operation** — nothing changes in your current work.

## 2. `git pull`

- Does **everything** `fetch` **does** + **automatically merges** the new changes into your current branch.

Equivalent to:

```plaintext
git fetch
git merge
```

(or `rebase` if configured).

### Example:

```plaintext
git pull origin main
```

**Not as safe**, because it may cause **merge conflicts** immediately.

## Summary Table

| Command | Fetches remote changes | Updates working directory | Risk of conflicts |
| --- | --- | --- | --- |
| **git fetch** | Yes | No | No |
| **git pull** | Yes | Yes (merge/rebase) | Yes |

## When to use what?

- **Use** `git fetch` **when:**

   - You want to check new changes before merging.
   - You want full control over when to merge.
   - You want to avoid breaking your current code.

- **Use** `git pull` **when:**

   - You trust the remote changes and want them directly.
   - You want faster updates and don’t need a preview.


---

Original Source: https://www.mindstick.com/forum/161786/what-is-the-difference-between-git-pull-and-git-fetch

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
