Git for Engineers — Level by Level›Level 2 · Cheat sheet & self-check

Level 2 — Working in a team · wrap-up

Cheat sheet & self-check

9 questions across 3 lessons. Each answer links back to the lesson it came from.

Pick an answer to see if you got it, and why.

  1. Q1. What's the difference between git fetch and git pull?

    Show answer

    B. fetch is always safe; pull changes your working branch. Many engineers fetch first and look before integrating.

    From lesson 04 · Remotes and pull requests
  2. Q2. Why protect the main branch?

    Show answer

    B. Branch protection turns 'main is always releasable' from a hope into a rule the server enforces.

    From lesson 04 · Remotes and pull requests
  3. Q3. What makes a pull request easy to review?

    Show answer

    B. Reviewers can reason about a few hundred focused lines; they skim thousands. Size and context drive review quality.

    From lesson 04 · Remotes and pull requests
  4. Q4. What's the core idea of trunk-based development?

    Show answer

    B. Frequent small integrations avoid painful merges and let CI/CD deploy main continuously.

    From lesson 05 · Branching strategies and releases
  5. Q5. In semantic versioning, what does a MAJOR bump (2.0.0) signal?

    Show answer

    B. MAJOR = breaking change, MINOR = compatible feature, PATCH = compatible fix.

    From lesson 05 · Branching strategies and releases
  6. Q6. A critical bug is fixed on main, but production runs release/1.4. What's the safe approach?

    Show answer

    B. Cherry-picking moves just the fix. Fixing main first (or confirming it's there) prevents the bug returning in the next release.

    From lesson 05 · Branching strategies and releases
  7. Q7. A bad commit is already on the shared main branch. How do you undo it?

    Show answer

    B. Revert is safe for shared history: nobody else has to reconcile rewritten commits.

    From lesson 06 · Undo and recovery
  8. Q8. You ran git reset --hard and lost two commits you hadn't pushed. Can you get them back?

    Show answer

    B. Commits stay in the repository until garbage-collected (typically weeks). The reflog remembers where HEAD pointed.

    From lesson 06 · Undo and recovery
  9. Q9. What does git bisect do?

    Show answer

    B. Among 1,000 commits it needs about 10 steps. With a test script (git bisect run) it finds the culprit automatically.

    From lesson 06 · Undo and recovery