Practice advanced Git vocabulary: interactive rebase, cherry-pick, git bisect, reflog, and squash commits — operations used to manage complex repository histories.
0 / 13 completed
1 / 13
'Interactive rebase cleans up the commit history.' What can you do with git rebase -i?
git rebase -i (interactive rebase) opens a list of commits you can manipulate: pick (keep), squash (combine with previous), fixup (squash without keeping message), reword (edit message), drop (remove), and reorder by changing the list order. It's typically used to clean up messy work-in-progress commits into a coherent history before submitting a pull request.
2 / 13
'Cherry-pick applies a specific commit to another branch.' When would you use git cherry-pick?
git cherry-pick takes the changes from a specific commit (identified by its hash) and applies them as a new commit on the current branch. Common use cases: backporting a critical bug fix to an older release branch, applying a hotfix to both main and a release branch simultaneously, or selectively taking a commit from one feature branch to another.
3 / 13
'Git bisect finds the commit that introduced the bug.' How does git bisect work?
git bisect automates binary search through commit history to find which commit introduced a regression. You start bisect, mark the current state as 'bad' and a known good commit as 'good'. Git checks out a midpoint commit; you test and mark it good or bad. Repeat until bisect identifies the exact commit that introduced the bug. For 1,000 commits, it finds the culprit in ~10 steps.
4 / 13
'The reflog is the undo for any git operation.' What does the reflog record?
The reflog (reference log) records every position HEAD has been, including after destructive operations like git reset --hard or git rebase. Even if commits appear 'lost' from the branch, they're in the reflog for 90 days. You can recover them with git checkout or git reset to a reflog entry. The reflog is local and private — it doesn't sync to remote.
5 / 13
'We squash commits before merging to main.' What does squashing commits mean?
Squashing combines multiple commits into one. If a feature branch has 20 commits (including 'WIP', 'fix typo', 'oops revert that') these are collapsed into one clean commit ('Add user authentication feature') before merging to main. This keeps the main branch history readable — each commit represents a complete, meaningful change rather than implementation noise.
6 / 13
Sarah from the QA team just commented on your PR: 'This commit seems to have introduced a regression in the user authentication flow. Can you use git cherry-pick to apply the fix from branch develop?' What does git cherry-pick primarily allow you to do?
git cherry-pick is used to selectively apply individual commits from one branch to another. It doesn't merge branches; instead, it takes the changes introduced by a specific commit and applies them as a new commit on your current branch. This is useful when you only need a small portion of a change from another branch without merging the entire history.
7 / 13
Mark sent this Slack message: 'I'm trying to resolve a conflict caused by a recent merge. I ran git status and it says there are unresolved changes in both branches. I need to figure out how to cleanly integrate these changes without losing any work.' Which of the following best describes what Mark is likely facing?
Mark's message indicates he's dealing with a divergence between branches after a merge. This typically occurs when changes have been made on both branches independently since the last common ancestor. Resolving this often involves techniques like rebase or cherry-pick to bring the branches back into alignment, rather than a simple merge.
8 / 13
David from the backend team just posted this comment on your PR:
"I'm seeing some unexpected behavior with the API endpoint. It seems like a recent commit might have introduced a race condition. Could you investigate using git log --graph to visualize the branch history and identify potential conflicts?"
Git log --graph provides a visual representation of your commit history, making it easier to identify branches that merged or diverged around the time of the reported issue. The other options—git bisect, git diff, and reflog—are useful for different debugging scenarios but don't directly address visualizing branch relationships. Understanding the graph is key here.
9 / 13
During a code review for your PR introducing a new feature, Alex from the security team asks: 'This commit introduces a potential vulnerability – it doesn't properly sanitize user input before using it in our database query. Could you use git rebase -i to combine this commit with the previous one where the sanitization logic was implemented?' What does Alex likely mean by suggesting a git rebase -i?
Git rebase -i allows you to interactively manipulate your commit history. Alex is suggesting that instead of merging (which creates a merge commit), you can combine these two commits into one by rewriting the history, effectively making this commit appear as if it was originally based on the previous commit. This avoids unnecessary merge commits and provides a cleaner history.
10 / 13
You're working with a feature branch that's significantly diverged from the main branch. You need to apply just one specific commit from this branch into your current `main` branch without merging the entire branch. Which Git command is most suitable for achieving this?
Git cherry-pick is designed precisely for this scenario. It allows you to select and apply individual commits from one branch to another. Using `git merge` would incorporate the entire feature branch's history, while `git rebase` rewrites history and `git reset --hard` discards local changes. 'git checkout' is used to switch branches.
11 / 13
During a standup meeting, your team lead asks you about the recent build failures. You discover that a bug was introduced by a commit that has since been merged into `main`. You need to quickly isolate this problematic commit. What tool should you use?
Git bisect is a powerful command specifically designed for efficiently finding the commit that introduced a bug. It works by repeatedly dividing the codebase in half and testing commits until it identifies the culprit. `git log` displays the commit history, `git diff` shows changes between commits, and `git blame` identifies which commit modified each line of code.
12 / 13
You're investigating a complex merge conflict. After running git status, you notice that the reflog contains several entries related to your recent operations. What is the primary purpose of the Git reflog?
The reflog is crucial for recovering lost commits. It records every change made to the object database – commits, trees, blobs – regardless of whether those changes were part of a public history. This allows you to 'rewind' back to an earlier state if a commit is accidentally deleted or altered.
13 / 13
Your team has adopted a policy of squashing commits before merging them into the main branch. A junior developer asks: 'What exactly does 'squashing commits' mean?'
Squashing commits involves taking several related but distinct commits and merging them into one new, single commit. This simplifies the project's history by reducing noise and making it easier to understand the overall flow of development. The new commit will have a descriptive message summarizing all the changes.
What does this Version Control Strategy Language exercise cover?
This exercise, "Advanced Git Vocabulary", tests your understanding of version control strategy language vocabulary and phrasing through 13 multiple-choice questions drawn from real workplace scenarios.
Is this exercise free to use?
Yes. Every exercise on CoderSlingo, including this one, is completely free — no account, sign-up, or payment required.
How many questions does this exercise have?
This exercise has 13 questions. Each one presents a realistic sentence or scenario with multiple-choice options and an explanation once you answer.
What happens after I answer a question?
You'll see immediate feedback showing whether your answer was correct, along with a short explanation of why — then a button to move to the next question.
Can I retry the exercise if I get questions wrong?
Yes. Once you reach the results screen, click "Try again" to reset your answers and go through the exercise from the start as many times as you like.
Do I need to create an account to take this exercise?
No account is needed. Your answers are scored in your browser during the session — nothing is saved to a server, so you can jump straight in.
Is my progress saved if I leave the page?
No — progress within an exercise resets if you navigate away or reload. Each exercise is short enough to complete in a few minutes in one sitting.
Who is this Version Control Strategy Language exercise for?
It's designed for IT professionals and learners who want to sound natural discussing version control strategy language topics in English — useful for meetings, documentation, interviews, and day-to-day communication with English-speaking teams.
How is this different from reading a glossary or blog article?
Exercises like this one are active recall drills — you have to choose the correct term or phrasing yourself, which builds retention faster than passively reading a definition.
Where can I find more Version Control Strategy Language exercises?
Browse the full Version Control Strategy Language exercises hub for more practice, or explore other exercise categories covering vocabulary, grammar, interviews, and workplace communication.