Practice Version Control in CS Thinking
Use these practice problems to test your method after reviewing the concept explanation and worked examples.
Quick Recap
A system that records changes to files over time so you can recall specific versions, compare changes, and collaborate without overwriting each other's work. Git is the most widely used version control system, using concepts like commits (snapshots), branches (parallel lines of development), and merges (combining changes).
Version control is an unlimited undo button for your entire project β plus the ability for multiple people to work on the same files simultaneously.
Showing a random 20 of 50 problems.
Example 1
mediumYou want to temporarily set aside uncommitted changes to switch branches, then restore them later. Which Git feature does this?
Example 2
mediumYou committed a secret API key 10 commits ago. You ran and committed. Is the secret safe now?
Example 3
hardThree feature branches each made 2 commits from main. They all merge sequentially. Main was at ; now it has how many MORE commits at minimum (assuming no fast-forward)?
Example 4
easyWhat is version control and why is it important? Describe what happens without it.
Example 5
mediumA feature branch has 5 commits. You want a single tidy commit on main. Which workflow achieves this?
Example 6
mediumTwo developers both edit the same line of the same file on different branches. What happens when they try to merge? How should this be resolved?
Example 7
challengeA branch was created from main at commit (the common ancestor). The branch added 3 commits and main added 2 commits, none touching the same files. Using a three-way merge, how many commits are processed to build the merge result, and how many parents does the merge commit have?
Example 8
hardA merge commit has 2 parents. A fast-forward merge produces how many new commits and how many parents?
Example 9
easyWhich Git command downloads the latest commits from the remote and merges them?
Example 10
hardExplain how version control supports the maintenance stage of the SDLC. Describe a scenario where the ability to revert to a previous version saves a project.
Example 11
easyTrue or false: version control lets multiple people work on the same files at the same time.
Example 12
challengeGiven the commit chain , a bug was introduced between and . Which Git command finds the offending commit in steps via binary search?
Example 13
mediumTwo engineers edit different lines of the same file in separate branches. They merge sequentially into main. How many conflicts arise?
Example 14
easyWhich Git command uploads your local commits to a remote repository?
Example 15
easyWhich Git command creates a new branch named 'feature'?
Example 16
mediumAfter an automatic merge fails, Git inserts markers in the file. After the line beginning with '<<<<<<<', whose changes appear first?
Example 17
mediumOrder these into the standard collaborative workflow: (1) commit, (2) pull latest, (3) push, (4) make changes. Give the sequence.
Example 18
easyTwo branches edited the SAME line of the same file differently. What does Git report when you merge them?
Example 19
easyBefore starting new work on a shared branch, what should you do first to reduce conflicts?
Example 20
mediumExplain these Git operations and their purpose: commit, branch, merge. How do they support team collaboration?