What is git pull --rebase, and why might a team prefer it over a default pull?
Last updated
git pull --rebasefetches remote commits and replays your local commits on top, instead of the default fetch + merge that creates a merge commit.Teams prefer it for a clean linear history that is easier to review and bisect. Make it the default with
git config pull.rebase true.Caveat: it rewrites local commit SHAs, so use it only on unshared commits. Conflicts may need resolving per replayed commit.
- https://dev.to/mliakos/don-t-git-pull-use-git-pull-rebase-instead-5b8k
- https://medium.com/@dev.zainulabbdin/git-pull-rebase-vs-no-rebase-d6b66c25090f
- https://git-scm.com/docs/git-pull/2.25.1
- https://medium.com/@ruqaiya.beguwala/day-13-30-git-pull-rebase-keep-your-history-linear-when-pulling-changes-8b28e6430263
- https://www.atlassian.com/git/tutorials/syncing/git-pull
- https://medium.com/@DGabeau/git-pull-rebase-vs-git-pull-c2b352fe53aa
- https://dev.to/ladoxer/why-i-stopped-using-plain-git-pull-and-why-you-should-too-2anl
- https://dev.to/mdenda/why-git-pull-rebase-should-probably-be-your-default-32e1