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

Level 1 — Foundations · wrap-up

Cheat sheet & self-check

10 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 does a Git commit store?

    Show answer

    B. Git stores snapshots; diffs are computed when you ask for them. Unchanged files are shared between snapshots, so it stays small.

    From lesson 01 · How Git works
  2. Q2. What is a branch in Git?

    Show answer

    B. Branches are cheap pointers. Creating one writes one small file; that's why branching in Git is instant.

    From lesson 01 · How Git works
  3. Q3. Between which areas does `git add` move changes?

    Show answer

    A. `git add` stages changes into the index; `git commit` turns the index into a new snapshot.

    From lesson 01 · How Git works
  4. Q4. Why can't a commit be changed without its SHA changing?

    Show answer

    B. Content addressing makes history tamper-evident: changing anything in the past changes every SHA after it.

    From lesson 01 · How Git works
  5. Q5. You changed a bug fix and some unrelated formatting in the same file. How do you make two clean commits?

    Show answer

    B. Interactive staging lets each commit contain exactly one logical change, which makes review, revert and blame far more useful.

    From lesson 02 · The everyday workflow
  6. Q6. What belongs in .gitignore for an infrastructure repository?

    Show answer

    B. Ignore generated, local and secret files. Never rely on .gitignore alone for secrets though; scan for them too.

    From lesson 02 · The everyday workflow
  7. Q7. When is git commit --amend safe?

    Show answer

    B. Amending rewrites the commit. Once others have it, rewriting forces them to reconcile diverged history.

    From lesson 02 · The everyday workflow
  8. Q8. When does a merge become a fast-forward?

    Show answer

    B. If main hasn't moved, no merge commit is needed: main simply points at the feature's latest commit.

    From lesson 03 · Branching and merging
  9. Q9. What's the golden rule of rebasing?

    Show answer

    B. Rebasing your own local or personal branch is fine. Rewriting shared history forces everyone else to untangle it.

    From lesson 03 · Branching and merging
  10. Q10. What do the conflict markers <<<<<<<, ======= and >>>>>>> separate?

    Show answer

    B. Git couldn't combine the edits automatically. You decide the final content, remove the markers, then add the file.

    From lesson 03 · Branching and merging