Module Quiz
Complete this after the concept and practice pages. Answer from memory first, then correct using the linked concept pages.
Current Module Questions
Question 1: Snapshot Model
What is the most useful mental model for a Git commit?
a) A zip file of only changed lines
b) A snapshot of the project state plus metadata and parent links
c) A copy of the working directory outside the repository
d) A remote backup event
Answer: (b)
Why: Git thinks in snapshots and references, not just file-by-file deltas.
Remediation: Review Git Mental Model.
Question 2: The Index
What is the index or staging area?
Answer: It is the proposed next commit. It holds the exact file versions Git will use when you commit.
Question 3: Reading Diffs
What is the difference between git diff and git diff --staged?
Answer: git diff compares the working tree to the index. git diff --staged compares the index to the last commit.
Question 4: Commit Scope
Why is git add -p valuable?
Answer: It lets you stage selected hunks instead of whole files, so unrelated edits can be split into separate commits.
Question 5: History Inspection
Which command combination is most useful for quickly seeing branch shape and commit messages?
a) git status --graph
b) git log --oneline --graph --decorate --all
c) git show --cached
d) git branch --full
Answer: (b)
Question 6: Branch Meaning
What happens when you create a branch with git branch feature?
Answer: Git creates a new movable reference pointing at the current commit. It does not copy the repository files.
Question 7: Merge vs Rebase
When is rebasing usually acceptable?
Answer: On local, unpublished topic branches where you want a cleaner linear history and are not rewriting shared history.
Question 8: Fetch vs Pull
What is the difference between git fetch and git pull?
Answer: fetch updates remote-tracking references only. pull fetches and then integrates into the current branch, usually by merge.
Question 9: Remote-Tracking Branches
What does origin/main represent?
Answer: A local remote-tracking reference recording where the remote branch main on origin was the last time Git communicated with that remote.
Question 10: Push Behavior
Why does Git require an explicit push to share a local branch?
Answer: Local branches are private by default. Git only publishes the branches you explicitly push.
Question 11: Conflict Resolution
What do the <<<<<<<, =======, and >>>>>>> markers mean during a merge?
Answer: They mark conflicting sections from two versions of the file so you can edit the final intended result manually.
Question 12: Pull Request Quality
What makes a pull request easier to review?
a) Large scope and many unrelated changes
b) Small focused changes with a clear description
c) Opening it only after many weeks of work
d) Avoiding commit messages because the diff is enough
Answer: (b)
Question 13: Commit Discipline
Why are many small coherent commits usually better than one giant commit?
Answer: They tell a clearer story, make review easier, simplify debugging, and reduce the cost of reverting or reworking part of the change.
Question 14: Safe Recovery
You want to temporarily shelve unfinished work before switching branches. What Git feature fits that need?
Answer: git stash stores staged and unstaged work so you can reapply it later.
Question 15: Reflog
What problem does git reflog help solve?
Answer: It helps recover commits or branch positions you moved away from locally, such as after a bad reset or rebase.
Question 16: Safe Rebase
You have a local branch with three commits that nobody else has pulled. main moved forward. What is a safe rebase workflow, and what should you inspect afterward?
Answer: Fetch first, rebase the local branch onto the updated remote-tracking branch, resolve conflicts one commit at a time, then inspect git log --oneline --graph --decorate and run tests before pushing. If the branch was already published, coordinate before force-pushing or prefer merge.
Question 17: Remote-Tracking References
Why is origin/main not the same thing as main?
Answer: main is your local branch. origin/main is your local record of where the remote branch was at the last fetch or pull. It can be stale until you communicate with the remote.
Question 18: Reviewable History
Name three signs that a branch history is ready for review.
Answer: Commits are focused, each commit builds or is at least easy to reason about, the branch has no accidental debug or generated files, and the final diff matches the pull request description.
Interleaved Review Questions
Prior Module Question 1: Systems vs Intentions
Why is "commit at the end of every coherent work unit" stronger than "use Git more consistently"?
Answer: The first is a repeatable system with a trigger and observable behavior. The second is only a vague intention.
Prior Module Question 2: Shell Navigation
Why does it matter that you know where the repository root is before running Git commands?
Answer: Because repository context, relative paths, and command output all depend on where you are in the filesystem.
Prior Module Question 3: Streams
Why is reading stderr useful during Git failures?
Answer: Git writes error details and merge or remote failure explanations there, which helps you diagnose the real problem.
Prior Module Question 4: Reproducibility
How does Git support the reproducibility mindset from Module 02?
Answer: It records change history, preserves workflow decisions, and makes development state shareable and reviewable.
Prior Module Question 5: Automation
What kind of repeated Git task might belong in an alias or small script?
Answer: A frequently repeated inspection sequence such as status, branch -vv, and a short graph log.
Scoring and Remediation
Mastery (90-100 percent):
- Ready to use Git as your default project workflow in the next semester.
Proficient (75-89 percent):
- Review each missed concept and repeat the matching practice page.
Developing (60-74 percent):
- Redo the repository-state and branching labs before advancing.
Insufficient (<60 percent):
- Rework Cluster 1 and Cluster 2 with fresh hands-on repository practice, then retake the quiz.
Remediation Map
- Misses on Questions 1-4: revisit snapshots, the index, and commit construction
- Misses on Questions 5-7: revisit history reading, branches, merges, and rebases
- Misses on Questions 8-12: revisit remotes, collaboration, and conflict handling
- Misses on Questions 13-18: revisit commit discipline, remotes, rebase safety, and recovery tools