Git Advanced Quiz
← Back to Quiz Home
Expert Mode Activated! 🧠
Ready to dive into the internals? This quiz challenges your knowledge of bisecting, reflogs, and commit manipulation.
Instructions:
- These questions cover advanced Git concepts.
- Select the correct commands and concepts.
- Good luck!
Which command uses a binary search to find the commit that introduced a bug?
git bisect uses a binary search algorithm to find which commit in your project's history introduced a bug.
Which command applies a specific commit from one branch to another?
git cherry-pick applies the changes introduced by some existing commits.
Reflogs record when the tips of branches and HEAD were updated. It is essential for recovering lost commits.
Which command allows you to interactively squash, edit, or reorder commits?
git rebase -i (interactive) launches an editor to modify the commit history.
What happens generally in a 'detached HEAD' state?
Authentication to check out a specific commit detach HEAD. New commits will not belong to any branch and can be easily lost if you switch away.
Which plumbing command displays the content of a Git object?
git cat-file -p pretty-prints the content of an object (blob, tree, commit, or tag).
What feature allows you to manage multiple working trees attached to the same repository?
git worktree allows you to have multiple branches checked out at different paths simultaneously.
What does git rerere stand for?
git rerere stands for "Reuse Recorded Resolution". It remembers how you resolved a conflict so it can resolve it automatically next time.
Which hook is triggered before a commit message is entered?
The pre-commit hook is run first, before you even type a message. It's often used for linting.
Which command is used to permanently rewrite history to remove a sensitive file from all commits?
git filter-repo (the modern successor to filter-branch) is used to rewrite history on a large scale.
What are the four main types of Git objects?
Git stores data as Blobs (files), Trees (directories), Commits (snapshots), and Tags.
Which command cleans up unnecessary files and optimizes the local repository?
git gc (garbage collect) cleans up loose objects and packs them into packfiles.
How do you transplant a range of commits from one branch to another base, omitting the original base?
git rebase --onto newbase oldbase helps transplant a sub-branch to a new parent.
Which command finds the most recent tag reachable from a commit?
git describe returns a human-readable name based on the nearest tag.
Where is the Git "Index" stored?
The index is a binary file stored at .git/index.
What distinguishes a "Bare" repository?
A bare repository contains only the .git contents (objects, refs) and no checkout of the files. Used for central servers.
Which command automates the bisect process using a script?
git bisect run <cmd> automatically runs the bisect process based on the exit code of cmd.
Which command creates a specific stash without adding it to the stash list (reflog)?
git stash create creates the stash commit object and returns the hash, but doesn't update refs.
What Git concept allows you to include another Git repository as a folder within your project?
Submodules point to a specific commit in another repository. (Subtree is a strategy, but Submodule is the explicit reference feature).
Which low-level command resolves a reference to a SHA-1 hash?
git rev-parse is an ancillary plumbing command used to manipulate and validate parameters and refs.
Quiz Progress
0 / 0 questions answered
(0%)
0 correct
Quiz Complete!
0%
📚 Study Guides
📬 Weekly DevOps, Cloud & Gen AI quizzes & guides