GH-900 ยท Version control and Git
Purpose and benefits of version control
Why teams track changes: history, rollback, collaboration, parallel work, accountability; centralized versus distributed version control.
Key points
- Version control records every change to a project: who changed what, when and why.
- It lets you go back to an earlier state, work in parallel on separate lines of work and merge them later, and review the history for accountability.
- Centralized systems keep history on one server; distributed systems such as Git give every contributor a full copy.
Source: https://docs.github.com/en/get-started/using-git/about-git
Practice questions
Which capability is a core benefit of using version control?
- Restoring an earlier state of the project from its recorded history
- Guaranteeing that code never contains bugs
- Preventing two people from ever editing the same file
- Compiling code automatically on every machine
Show answer
Answer: A. Restoring an earlier state of the project from its recorded history
Version control keeps a history you can inspect and restore. It does not remove the need for testing, make merge conflicts impossible, or replace backups of the hosting environment.
Which statements describe benefits of version control?
- Each change is recorded with its author and time
- Multiple people can work in parallel on separate lines of work
- Merge conflicts can never happen
- Code quality is enforced automatically without reviews or tests
- Files can be reverted to a previous recorded state
Show answer
Answer: A. Each change is recorded with its author and time, B. Multiple people can work in parallel on separate lines of work, E. Files can be reverted to a previous recorded state
History gives accountability and rollback, and branching enables parallel work. Version control does not enforce code quality by itself, and it does not eliminate conflicts; they are resolved when merging.
True or false: in a distributed version control system, each contributor's copy of the repository holds the full project history.
Show answer
Answer: True
True. Distributed systems like Git clone the whole history, so most operations work offline. The misconception is that only a central server has the history, which describes centralized systems.
Practice 8 questions on this topic in Bitzu
Short lessons, instant explanations and spaced review of what you get wrong. Free on iOS and Android.
