Last Updated: January 3, 2026
30 quizzes
Replay your current feature branch commits on top of the latest main branch to get a linear history before opening a pull request
git mainClick an option to fill the blank:
Continue an in-progress rebase after resolving all reported conflicts
git rebase Click an option to fill the blank:
Start an interactive rebase to clean up the last 5 commits before sharing the branch
git rebase HEAD~5Click an option to fill the blank:
Rewrite your current branch so that its unique commits are based on the specified new base commit using the flexible three-argument form
git rebase --onto 1a2b3c 4d5e6f Click an option to fill the blank:
Amend the last commit during an interactive rebase when Git has paused at a commit you marked for editing
git commit Click an option to fill the blank:
What is the main effect of rebasing a feature branch onto main instead of merging main into it?
When should you avoid rebasing a branch?
During an interactive rebase, which action should you choose to combine a 'fix typo' commit into the previous commit while discarding the 'fix typo' message?
How does a rebase differ from a merge when integrating main into a feature branch?
Which interactive rebase action lets you split a single commit into multiple smaller commits?
Order the steps to rebase your feature branch onto updated main and resolve a single conflict
Drag and drop to reorder, or use the arrows.
Order the steps to squash the last three commits on your current branch into a single commit using interactive rebase
Drag and drop to reorder, or use the arrows.
Order the steps to split the last commit into two separate commits using interactive rebase
Drag and drop to reorder, or use the arrows.
Order the steps to use git rebase --onto to move a topic branch from old-base to new-base
Drag and drop to reorder, or use the arrows.
You are on branch feature-login. What will this command print?
1git branch --show-currentYou are in the middle of a rebase and Git stopped at commit 'Refactor API'. What will this command output?
1git status --short --branchYour last commit message is 'Add search endpoint'. What does this command print?
1git log -1 --pretty=%sYou are rebasing feature onto main and no conflicts remain. What will this command output?
1git rebase --continue 2>/dev/null || echo "FAILED"Identify the incorrect command in this attempt to resolve a rebase conflict and continue
Click on the line(s) that contain the bug.
git statusgit add conflicted-file.jsgit rebase -continuegit log --oneline -5Find the incorrect command in this workflow for interactively editing the last 3 commits
Click on the line(s) that contain the bug.
git rebase -i HEAD-3git commit --amendgit rebase --continueFind the incorrect command in this attempt to move a branch using rebase --onto
Click on the line(s) that contain the bug.
git checkout topicgit rebase --onto old-base new-base topicgit push origin topic --force-with-leaseMatch each rebase-related command with its primary purpose
Click an item on the left, then click its match on the right. Click a matched item to unmatch.
Match interactive rebase actions with their effects on commits
Click an item on the left, then click its match on the right. Click a matched item to unmatch.
Match the history-editing scenarios with the most appropriate Git command
Click an item on the left, then click its match on the right. Click a matched item to unmatch.
Complete the commands to start an interactive rebase and mark a specific commit for editing
git rebase HEAD~3# In the editor, change the first line from:# abc123 Add API# to:# abc123 Add APIClick an option to fill blank 1:
Complete the commands to rebase a feature branch onto origin/main and handle a conflict
git checkout git fetch origingit rebase # after resolving conflictsgit add conflicted-file.jsgit rebase Click an option to fill blank 1:
Complete the commands to stop an in-progress rebase and restore the previous branch state
git status# decide to cancel the history rewritegit rebase # verify branch history againgit log --onelineClick an option to fill blank 1:
Select the line that shows you are in the middle of an interactive rebase
Click on the line to select.
On branch feature-cleanupYou are currently rebasing branch 'feature-cleanup' on 'main'. (fix conflicts and run "git rebase --continue") (use "git rebase --skip" to skip this patch) (use "git rebase --abort" to check out the original branch) Unmerged paths: both modified: src/app.jsSelect the line that indicates which commit is currently being applied during a rebase
Click on the line to select.
Applying: Add logging to payment flowUsing index info to reconstruct a base tree...M src/payment.jsSelect the line that shows the commit range being rebased
Click on the line to select.
First, rewinding head to replay your work on top of it...Applying: Add search APIApplying: Fix search API bugSuccessfully rebased and updated refs/heads/feature-search.