Udemy
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
Git Mastery: Tricky MCQ Practice Tests
New
100 students

Git Mastery: Tricky MCQ Practice Tests

200 tricky Git questions on staging, branching, merging, rebase, undo, remotes and internals, verified on Git 2.56
Created byLOGAKRISHNAN N
Last updated 11/2026
English

What you'll learn

  • Predict exactly what is staged, committed and ignored, and read short status codes with confidence.
  • Name any commit with revision syntax and search history with log, blame and grep.
  • Switch branches, handle detached HEAD and tags, and use switch and restore without losing work.
  • Merge safely, resolve conflicts correctly and choose between merge strategies and options.
  • Rewrite local history with rebase, autosquash, cherry-pick and revert, and undo mistakes with reset, stash and the reflog.
  • Collaborate through remotes without overwriting others' work, and understand Git objects, hooks and configuration.

Included in This Course

200 questions
  • Core Model: Index, Commits and History50 questions
  • Branching, Tags and Merging50 questions
  • Rewriting and Undoing History50 questions
  • Remotes, Internals and Tooling50 questions

Description

Test How Well You Really Know Git

Git feels simple until a command does something you did not expect. Why does a file you just changed go into the commit without your last edit? Why does git branch -d refuse a branch whose changes are already on main? During a rebase, why does --ours give you the other side? Where did the commit you made on a detached HEAD go? These practice tests check how well you can predict what Git really does, one short command sequence at a time.

What this practice test course offers:

  • 200 original multiple-choice questions in 4 practice tests of 50, grouped by topic
  • Short command sequences you must reason about: what does the last command print, what state is the repository in, or why does the command fail
  • An explanation for every answer option, plus an overall explanation of the rule behind it
  • Every command sequence was run with Git 2.56 in a clean repository, so every answer matches what real Git does
  • Current Git included: switch and restore, diff3 conflict markers, rebase --update-refs, add --resolved (2.56), the experimental git history fixup and drop commands, and the defaults planned for Git 3.0

Topics covered:

  • The working tree, the index and commits; ignore rules; status codes; diff, diff --staged and diff HEAD
  • Revision syntax (HEAD~2, HEAD^2, A..B, A...B, reflog selectors) and searching history with log, blame and grep
  • Branches, detached HEAD, tags, switch and restore
  • Fast-forward and merge commits, squash merges, conflicts, merge strategies and rerere
  • Rebase, interactive rebase, autosquash, cherry-pick and revert
  • reset, restore, stash, clean and recovering lost work with the reflog
  • Remotes, fetch, pull, push, force-with-lease, tags and refspecs
  • Git objects, configuration, aliases, hooks, bisect, worktrees, attributes and sparse checkout

Who should take this course?

  • Developers preparing for interviews where Git questions come up
  • Developers who use Git daily and want to stop guessing when a rebase or reset goes wrong
  • Team leads and DevOps engineers who define branching and release workflows

If you have never used Git, start with a Git fundamentals course and come back here to test yourself.

How to use the tests: take one test at a time, then read every explanation, including the ones for questions you answered correctly. Retake a test a few days later to check that the rules have stuck.

This course is independent and is not affiliated with or endorsed by the Git project or Software Freedom Conservancy.

Who this course is for:

  • Developers preparing for technical interviews that include Git questions.
  • Developers who use Git every day and want a precise model of what each command does.
  • Team leads and DevOps engineers who design branching, review and release workflows.
  • Students who have finished a Git course and want challenging practice questions.