Unlock hundreds more features
Save your Quiz to the Dashboard
View and Export Results
Use AI to Create Quizzes and Analyse Results

Sign inSign in with Facebook
Sign inSign in with Google

Git Quiz Practice Test

Boost your coding skills with interactive practice

Editorial: Review CompletedCreated By: Musthofa KamalUpdated Aug 28, 2025
Difficulty: Moderate
Grade: Grade 12
Study OutcomesCheat Sheet
Colorful paper art promoting The Git Guru Challenge, a trivia quiz for advanced students in computer science.

This Git quiz helps you practice core commands and workflows. You'll answer 20 high‑school level questions on commits, branches, merges, remotes, and .gitignore, so you can spot gaps before a class quiz or project and build good habits as you push, pull, and resolve conflicts.

Which command initializes a new Git repository in the current directory?
git new
git init
git create
git start
undefined
git status displays the state of the working tree and staging area.
False
True
undefined
Which command stages a file named app.js for commit?
git track app.js
git add app.js
git stage app.js
git commit app.js
undefined
git clone copies an existing repository and its history to a new local directory
True
False
undefined
Which command records staged changes with a message in one line?
git save "message"
git log -m "message"
git push -m "message"
git commit -m "message"
undefined
git pull is equivalent to git fetch followed by git merge by default
False
True
undefined
A fast-forward merge does not create a merge commit
False
True
undefined
Which command compares working tree changes against the index for file README.md?
git status -d README.md
git show README.md
git compare README.md
git diff README.md
undefined
git revert creates a new commit that undoes the changes from a specified commit
True
False
undefined
Which command removes a tracked file from the index but keeps it in the working directory?
git rm
git rm --cached
git clean -f
git reset --hard
undefined
A detached HEAD means HEAD points directly to a commit rather than a branch name
True
False
undefined
git reset --hard HEAD discards working tree and index changes to match HEAD
False
True
undefined
Which command sets the upstream tracking branch for the current branch to origin/main?
git push --set-upstream-to origin/main
git remote --set-upstream origin/main
git track origin/main
git branch --set-upstream-to=origin/main
undefined
git merge --no-ff forces a merge commit even when a fast-forward is possible
True
False
undefined
Which command starts an interactive rebase of the last 3 commits?
git rebase -I HEAD^3
git rebase -i HEAD~3
git rebase --edit 3
git rebase --interactive 3
undefined
git gc may pack loose objects and prune unreachable objects to optimize the repository
True
False
undefined
Which command initializes and updates all submodules recursively?
git submodule fetch --all
git submodule sync --recursive
git submodule init --all
git submodule update --init --recursive
undefined
Which command creates an additional working tree linked to the same repository?
git checkout --worktree
git worktree add
git tree add
git workspace add
undefined
git range A...B in log selects commits reachable by either A or B but not by both (symmetric difference)
True
False
undefined
git describe prints a human-readable name for a commit based on the nearest tag
False
True
undefined
0

Study Outcomes

  1. Understand fundamental Git concepts and terminology.
  2. Analyze common Git workflows and version control strategies.
  3. Apply Git commands for committing, pushing, and pulling changes.
  4. Evaluate branching and merging techniques in collaborative scenarios.
  5. Troubleshoot merge conflicts and identify resolution strategies.
  6. Interpret Git logs to trace and manage code revisions.

Git Quiz: Practice Test Cheat Sheet

  1. Understand core Git concepts - Dive into repositories, commits, branches, and merges - the building blocks of Git magic. Having these down makes teamwork a breeze and history tracking a piece of cake. Git Intro Tutorial
  2. Initialize a Git repository - Use git init to turn any folder into a version-controlled project. You'll get a .git folder under the hood, so you can start tracking changes and protecting your masterpiece. NCBI Git Init Guide
  3. Stage and commit changes - Practice staging with git add and freezing snapshots with git commit -m "message". It's like hitting a save point in a video game, giving you shield and restore powers against buggy code. UMD Git Tutorial
  4. Explore branching - Creating branches lets you audition wild ideas without messing up the main story. Switch and merge as you please, then integrate your best side quests back into the epic main plot. WPI Git Guide
  5. Merge branches - With git merge branch-name you bring features together and level up your main branch. Handle merge outputs with flair to keep the storyline of your code consistent and bug-free. WPI Git Guide
  6. Resolve merge conflicts - Sometimes two branches fight over the same line - enter conflict resolution! Learn how to pick, edit, and finalize the truce so your project moves forward smoothly. WPI Git Guide
  7. Check repository status - git status is like a project dashboard, revealing untracked files, staged changes, and the state of your code realm. Make it your daily ritual to stay in control. MIT Git Guide
  8. View commit history with git log - Scroll through your project's timeline like a time-traveler peeking at past adventures. Customize the format to spotlight heroes and hidden treasures (aka commits). UIO Git Lecture
  9. Undo mistakes - If you mess up, git revert rewinds changes gracefully, while git reset lets you rewrite history (careful!). Both commands are your lifelines when the code gremlins strike. UMD Git Tutorial
  10. Use .gitignore - Keep your repo tidy by listing files and folders that Git should ignore, like secret keys, binaries, or temp files. A well-crafted .gitignore file is the secret handshake for clean commits. WPI Git Guide
Powered by: Quiz Maker