What is git pull?
Answer
git pull fetches changes from the remote repository and immediately merges them into the current local branch. It is a combination of two operations: git fetch (downloads remote changes) + git merge (integrates them). Basic usage: git pull — pull from the tracked remote branch; git pull origin main — explicitly pull from origin's main branch. Pull with rebase (cleaner history): git pull --rebase — instead of creating a merge commit, replays your local commits on top of the fetched commits. This creates a linear history. Can be set as default: git config --global pull.rebase true. Pull options: git pull --no-commit — fetch and merge but don't automatically commit; git pull --ff-only — only pull if fast-forward is possible (fails if diverged — safe option to avoid accidental merge commits). Common issue: if local and remote have diverged, a simple pull creates a merge commit. Best practice: git fetch first to review remote changes, then decide to merge or rebase. git pull is one of the most used commands in daily workflow.