Suggest an editImprove this articleRefine the answer for “What happens by default with git pull?”. Your changes go to moderation before they’re published.Approval requiredContentWhat you’re changing🇺🇸EN🇺🇦UAPreviewTitle (EN)Short answer (EN)By default, **`git pull`** performs two operations in a row: `git fetch` and `git merge`. **Key point:** by default `git pull` runs `git fetch` and then `git merge`, merging the changes from the remote branch into the current local branch without rewriting history.Shown above the full answer for quick recall.Answer (EN)ImageBy default, `git pull` performs **two operations in a row**: `git fetch` **+** `git merge` That is, Git: 1. **fetches the changes** from the remote repository 2. **merges them** into the current local branch via `merge` --- ## Let's break it down step by step When you run: ```bash git pull ``` Git does the following: ### 1. `git fetch` - downloads new commits from the remote repository - **does not touch** your working code - updates the remote references (`origin/main`, `origin/dev`, etc.) ### 2. `git merge` - takes the corresponding remote branch - **merges it into the current local branch** - creates a **merge commit** if needed Merge is exactly what is used **by default**. --- ## Example You are on the `main` branch: ```bash git pull ``` This is equivalent to: ```bash git fetch origin git merge origin/main ``` --- ## What happens to the history - the history **is not rewritten** - a **merge commit** is possible - if there are conflicts, Git stops and asks you to resolve them --- ## Important point (often asked) `git pull` does **NOT** rebase by default If you want rebase, you need to specify it explicitly: ```bash git pull --rebase ``` or configure it in the config. --- ## Short answer for an interview > **By default,** `git pull` **runs** `git fetch`**, then** `git merge`**, merging the changes from the remote branch into the current local one without rewriting history.**For the reviewerNote to the moderator (optional)Visible only to the moderator. Helps review go faster.