git pull — Downloading Changes
git pull downloads changes from the remote AND immediately merges them into your current branch. It is a convenience shortcut combining git fetch (download) followed by git merge (integrate) into a single command.
01.What Pull Does in Two Phases
Phase 1 (fetch): downloads all new commits from the remote and updates the remote-tracking references like origin/main — your local branches are untouched. Phase 2 (merge): merges origin/main into your current local branch. This can produce merge commits or conflicts, just like any merge.
02.git pull --rebase (Recommended)
Instead of creating a merge commit, --rebase replays your local commits on top of the updated remote branch. Result: clean linear history with no merge commits. Many teams configure this as the default. Great rule of thumb: pull --rebase on feature branches, regular pull on main.
Commands
git pull is equivalent to which two commands run in sequence?