Instructions and covered skills
Read each scenario carefully before selecting an answer. Work in a quiet environment and turn off notifications before you begin. Focus on the stated branch, remote, and command context rather than assumptions from other workflows. Review command effects on commit history as well as file content. Do not rush through conflict-related scenarios, because the current rebase state matters. Choose the response that best preserves the intended work and collaboration outcome.
Key Areas
This test covers the decisions and commands involved in rebasing Git branches while protecting work that is already committed. Candidates interpret how git rebase changes parent relationships, moves feature commits onto a new base, and produces new commit identifiers even when the file changes appear similar. They work through conflict states by inspecting affected files, staging resolutions, continuing the operation, skipping an unnecessary patch, or aborting safely when the chosen approach is no longer appropriate.
The assessment also addresses interactive rebase operations used to curate local history. These include reordering commits, editing a commit, squashing related work, fixing up a follow-on correction, splitting a commit, and dropping work that should not be retained. Candidates should understand the practical consequences of each todo action and recognize when an operation changes only presentation versus when it changes the resulting content.
Collaboration safeguards are a central focus. Rewriting commits that other people have based work on can create avoidable disruption, so candidates must distinguish personal or private branches from branches with active shared use. They should know when to communicate before rewriting a remote branch and why git push --force-with-lease protects against overwriting remote updates that are not present locally.
Recovery knowledge is also evaluated. Candidates use reflog entries to locate earlier branch or HEAD positions, create a recovery branch before further changes, and select an appropriate reset mode when restoring a branch. They should recognize the difference between recovering commits, restoring files, and reversing changes on a branch that should retain its published history.
Recommended Preparation
Practice in a disposable repository with a main branch and several feature branches. Create commits that intentionally modify the same lines, then rebase one branch onto another and resolve the resulting conflicts. Run git status at each stage to observe the rebase state. Use interactive rebase on local commits to reorder, squash, edit, and drop changes, then inspect the log with graph output. Finally, simulate a mistaken reset or rebase and use git reflog to identify and restore the desired commit. Review team conventions for protected branches, pull requests, and force-push permissions before applying history-rewrite commands in a shared repository.