Computing and Information Technology

Git and Version Control Practice Exam, Flashcards & Questions

Master foundational to advanced Git and Version Control with 315 verified curriculum items, worked engineering solutions, and spaced-repetition cards.

210 Total Questions 140 MCQs 70 Flashcards
Free Interactive Preview

Git and Version Control Sample Exam Questions & Rationale

Preview official questions below. The complete pool of 210 items is available in the offline app.

Question 1 of 4 Branch naming

Which branch naming convention is an industry best practice for organizing team branches by intent and purpose?

A Naming all branches with arbitrary numbers like `1`, `2`, and `3`.
B Naming all branches after the current calendar month and year.
C Using spaces and special characters like `my new code #1!`.
D Prefixing with category slashes, such as `feature/issue-123-auth`, `bugfix/cart-crash`, and `hotfix/ssl-expiry`.
Accepted Answer: Option D (Prefixing with category slashes, such as `feature/issue-123-auth`, `bugfix/cart-crash`, and `hotfix/ssl-expiry`.)

Rationale: Using hierarchical slash prefixes (`feature/`, `bugfix/`, `release/`, `hotfix/`) standardizes branch organization, enables wildcards in CI, and clarifies intent.

Question 2 of 4 Cloning versus initializing

How does `git clone` differ from `git init` when setting up a local repository?

A `git init` creates an empty local repository in an existing directory, whereas `git clone` downloads an existing remote repository with its full commit history.
B `git init` requires an active internet connection to contact GitHub.
C `git clone` deletes the remote repository after downloading it locally.
D `git clone` cannot be used on open-source software projects.
Accepted Answer: Option A (`git init` creates an empty local repository in an existing directory, whereas `git clone` downloads an existing remote repository with its full commit history.)

Rationale: `git init` bootstraps a brand new repository locally from scratch. `git clone` copies an existing repository, configures remote tracking branches, and checks out main.

Question 3 of 4 Commit messages

According to standard Git commit message conventions, what grammatical mood should be used in the subject line?

A Past tense (e.g. 'Fixed memory leak' or 'Added payment gateway')
B Present continuous (e.g. 'Fixing memory leak' or 'Adding payment gateway')
C Imperative mood (e.g. 'Fix memory leak' or 'Add payment gateway')
D Passive voice (e.g. 'Memory leak was fixed by author')
Accepted Answer: Option C (Imperative mood (e.g. 'Fix memory leak' or 'Add payment gateway'))

Rationale: Git conventions dictate imperative mood: complete the sentence 'If applied, this commit will [subject line]'. This matches Git-generated messages like 'Merge branch'.

Question 4 of 4 Configuring Git

Which configuration scope sets Git user identity parameters across all repositories on the local user account?

A --local
B --worktree
C --global
D --system
Accepted Answer: Option C (--global)

Rationale: Git configuration priority order is: `--local` (repository specific) > `--global` (user account: `~/.gitconfig`) > `--system` (machine system-wide: `/etc/gitconfig`).

Active Recall Spaced Repetition Cards (Preview)

Card 1 • Branch naming
Execute the command `git branch {{c1::-m}} main`.
The `-m` (or `-M` to force) flag renames a branch in Git, updating the reference under `.git/refs/heads/` and reflog history seamlessly.
Card 2 • Cloning versus initializing
Use the command `git init {{c1::--bare}}`.
Bare repositories contain only the Git database (contents of `.git`) without a checked-out working directory, preventing working copy conflicts when pushed to.

Git and Version Control Curriculum Modules & Topics Covered

Modules
BasicsBranching and MergingRemotes and RecoveryCollaboration and CI
Core Exam Topics
  • Repositories and commits
  • Staging area
  • Viewing history
  • Ignoring files
  • Configuring Git
  • Commit messages
  • Diff and blame
  • Git objects (blob tree commit)
  • Cloning versus initializing
  • Branch naming
Learning Objectives
  • Develop core conceptual recall and analytical problem-solving in Basics.
  • Develop core conceptual recall and analytical problem-solving in Branching and Merging.
  • Develop core conceptual recall and analytical problem-solving in Remotes and Recovery.
  • Develop core conceptual recall and analytical problem-solving in Collaboration and CI.

Free Downloadable Git and Version Control Study Packs (.ZIP / .TSV)

Full Spreadsheet Data (TSV)
TSV • 210 items
Complete Course Pack
ZIP • 210 items
Elements (Complete)
ZIP • 210 items
Elements (Mastery)
ZIP • 210 items
Elements (Standard)
ZIP • 210 items
Active Recall Flashcards
ZIP • 210 items
Formula Codex
ZIP • 210 items
Artificial Intelligence (1,579) Artificial Intelligence and Machine Learning (507) Cloud Computing and DevOps (144) Compiler Design & Formal Languages (1,579) Computational Contact Mechanics: Penalty Function Method, Lagrange Multipliers & Mortar Contact Formulations (128) Computer Engineering & Algorithms (1,365)
Full Question Pool: 210 Verified Items

Unlock All 210 Git and Version Control Practice Questions

Study the full question pool with 13 active recall battle modes, FSRS v5 spaced repetition, and 1-click printable PDF mock exams with full answer keys on Android and Windows PC.

Get on Google Play (Android) Get on Microsoft Store (Windows PC)