Interview Q&A / Git & GitHub

INTERVIEW Q&A · 97 QUESTIONS

Git & GitHub interview questions

Branching, merge vs rebase, resolving conflicts and pull requests, the way teams actually work.

  1. What is the difference between git fetch and git pull?

    git fetch downloads new commits from the remote and updates your origin/* references without touching your own branch. git pull does a fetch and then merges (or rebases) the result into your current branch.

    BeginnerQuick answer1 min read
  2. What does git pull --rebase do, and why do many teams prefer it?

    It fetches remote changes and replays your local commits on top of them instead of creating a merge commit. The result is a linear history without noisy 'Merge branch main' commits.

    IntermediateQuick answer1 min read