Suggest an editImprove this articleRefine the answer for “Can git pull be configured to rebase?”. Your changes go to moderation before they’re published.Approval requiredContentWhat you’re changing🇺🇸EN🇺🇦UAPreviewTitle (EN)Short answer (EN)**Yes**, it can: the `pull.rebase=true` setting makes `git pull` do a rebase instead of a merge. **Key point:** this can be enabled globally, per repository, or for a specific branch.Shown above the full answer for quick recall.Answer (EN)ImageYes, you can. Git can be configured so that `git pull` **does a rebase instead of a merge by default**. --- ## Option 1: Enable rebase for all repositories (globally) ```bash git config --global pull.rebase true ``` After this, `git pull` will be equivalent to `git pull --rebase` (in most ordinary cases). To check: ```bash git config --global --get pull.rebase ``` --- ## Option 2: Enable rebase only in the current repository ```bash git config pull.rebase true ``` This affects only the current project. --- ## Option 3: Configure rebase only for a specific branch For example, only for `main`: ```bash git config branch.main.rebase true ``` Now, when you are on `main` and run `git pull`, it will do a rebase. --- ## A useful setting: automatically stash local changes during a rebase If you often have uncommitted changes, this is handy: ```bash git config --global rebase.autoStash true ``` Then Git will automatically stash before the rebase and restore the changes afterward. --- ## How to turn it off (go back to merge) Globally: ```bash git config --global pull.rebase false ``` Or remove the setting: ```bash git config --global --unset pull.rebase ``` --- ## Phrasing for an interview > **Yes, you can: the** `pull.rebase=true` **setting makes** `git pull` **do a rebase instead of a merge. This can be enabled globally, per repository, or for a specific branch.**For the reviewerNote to the moderator (optional)Visible only to the moderator. Helps review go faster.