🌍 Git & Version Control · subject
Git & Version Control Version Control Fundamentals Syllabus
The Version Control Fundamentals syllabus for Git & Version Control in full: 4 chapters and 15 topics, every one listed below, plus 51 Version Control Fundamentals flashcards with answers.
Version Control Fundamentals syllabus: all 4 chapters
Expand any chapter to see its topics and sub-topics.
-
Introduction to Version Control
4 topics- What Is Version Control
- Local, Centralized, and Distributed Systems
- Why Git
- A Short History of Git
-
Installing and Configuring Git
4 topics- Installing Git on Windows, macOS, and Linux
- First-Time Git Setup
- Configuration Levels
- Getting Help
-
Git Internals and Data Model
4 topics- The Three States
- Git Objects
- The .git Directory
- References and HEAD
-
Git on the Command Line
3 topics- The Shell and Terminal Basics
- Aliases and Shortcuts
- GUI Clients vs CLI
Git & Version Control Version Control Fundamentals flashcards — 51 questions with answers
What is version control?
A system that records changes to a file or set of files over time so that you can recall specific versions later, revert files, compare changes, and see who modified what and when.
What is a Version Control System (VCS) primarily used to track in software development?
Changes to source code (and other project files), enabling collaboration, history tracking, branching, and recovery of previous states.
Name three broad categories of version control systems.
Local Version Control Systems (LVCS), Centralized Version Control Systems (CVCS), and Distributed Version Control Systems (DVCS).
How does a Local Version Control System work, and what is a classic example?
It keeps versions of files in a simple database on a single local machine (e.g., patch sets between versions). A classic example is RCS (Revision Control System).
What is the main weakness of a Local Version Control System?
Everything is stored on one computer, so it does not support collaboration and a single disk failure can lose all history.
How does a Centralized Version Control System (CVCS) store data, and give examples.
It has a single central server holding all versioned files; clients check out files from that central place. Examples include CVS, Subversion (SVN), and Perforce.
What is the biggest single point of failure in a Centralized VCS?
The central server: if it goes down, no one can collaborate or save versioned changes, and if its disk is corrupted without backups, the entire project history can be lost.
How does a Distributed Version Control System (DVCS) differ from a centralized one?
In a DVCS, clients fully mirror the repository including its complete history, so every clone is a full backup and most operations are local. Examples: Git and Mercurial.
Why does a DVCS offer better redundancy than a CVCS?
Because every client has a full copy of the repository and its history, any client copy can restore the server, eliminating the single point of failure.
State three practical advantages of Git over centralized systems.
Speed (most operations are local), full offline history and full backups on every clone, and cheap, fast branching and merging.
How does Git think about and store its data compared to older VCS tools?
Git stores data as a series of snapshots of the entire filesystem, not as a list of file-based differences (deltas); unchanged files are stored as a reference to the previous identical file.
Why are nearly all Git operations fast and usable offline?
Because the entire project history is stored locally, so operations like commit, diff, log, and branch do not require a network connection to a server.
What integrity mechanism does Git use so that content cannot be changed without Git knowing?
Everything is checksummed (content-addressed) using a hash before it is stored, and it is referred to by that checksum; corruption or tampering is detectable.
Which hash algorithm does Git traditionally use for checksums, and what is its output length?
SHA-1, which produces a 40-character hexadecimal string ($40$ hex characters = $160$ bits).
When and by whom was Git created?
Git was created in 2005 by Linus Torvalds (with the Linux kernel development community) after the free use of the proprietary BitKeeper system ended.
List the original design goals that shaped Git in 2005.
Speed, simple design, strong support for non-linear development (thousands of parallel branches), fully distributed, and able to handle very large projects like the Linux kernel efficiently.
How do you install Git on most Linux distributions using a package manager (Debian/Ubuntu vs. Fedora)?
Debian/Ubuntu: sudo apt install git-all (or sudo apt install git). Fedora: sudo dnf install git-all.
How is Git typically installed on macOS?
By installing the Xcode Command Line Tools (running git triggers the prompt, or xcode-select --install), or via a package manager such as Homebrew: brew install git.
How is Git installed on Windows?
By downloading the official 'Git for Windows' installer from git-scm.com, which includes Git Bash; it can also be installed via winget or Chocolatey.
What command verifies that Git is installed and shows the version?
git --version
Show the other 31 Version Control Fundamentals flashcards
What is the first thing you should configure after installing Git, and with which commands?
Your identity — user name and email — using: git config --global user.name "Your Name" and git config --global user.email "you@example.com". This identity is baked into every commit.
Which command sets your default text editor for Git commit messages?
git config --global core.editor <editor>, for example git config --global core.editor "vim".
What are the three configuration levels in Git, from lowest to highest priority?
System level (--system, /etc/gitconfig), Global/user level (--global, ~/.gitconfig or ~/.config/git/config), and Local/repository level (--local, .git/config). Higher-priority levels override lower ones.
Which config level applies to every user on the system, and where is its file stored?
The system level, set with git config --system; stored in /etc/gitconfig (or Git installation path on Windows).
Which config level takes precedence when the same key is set at system, global, and local levels?
The most specific (local/repository) level wins, overriding global, which overrides system.
How do you view all of your Git settings and see which config file each came from?
git config --list to view all settings, and git config --list --show-origin to see the file each value came from. Use git config <key> to read a single value.
Give three ways to get help for a Git command from the command line.
git help <command>, git <command> --help, and man git-<command>. A concise option summary is available via git <command> -h.
What are the three main states a file can be in within Git?
Modified, Staged, and Committed.
Define the 'modified' state in Git.
The file has been changed in the working directory but the change has not yet been staged (added to the index).
Define the 'staged' state in Git.
A modified file has been marked (via git add) to go into the next commit; it sits in the staging area (index).
Define the 'committed' state in Git.
The data is safely stored in the local Git database (the .git directory); the staged snapshot has been recorded permanently as a commit.
What are the three main sections/trees of a Git project that correspond to the three states?
The working directory (working tree), the staging area (index), and the Git directory (.git repository/database).
What is the staging area (index) in Git?
A file, generally in the .git directory, that stores information about what will go into your next commit; it lets you build up commits selectively before recording them.
Outline the basic Git workflow across the three trees.
You modify files in the working directory, selectively stage the changes you want (git add) into the index, then commit (git commit) to store a permanent snapshot in the .git directory.
What are the four fundamental object types Git stores in its database?
Blob (file contents), tree (directory listing pointing to blobs and other trees), commit (a snapshot with metadata), and tag (annotated tag object).
What does a Git blob object store?
The raw contents of a file — just the data, with no filename or metadata; the blob is identified by the SHA-1 of its contents.
What does a Git tree object represent?
A directory: it lists filenames and permissions, pointing to blob objects (files) and other tree objects (subdirectories).
What information does a Git commit object contain?
A pointer to the top-level tree (the snapshot), the author and committer with timestamps, the commit message, and pointers to zero or more parent commits.
How is a Git object's identity/storage key determined, making Git a content-addressable filesystem?
By computing the SHA-1 hash of the object's contents; identical content always yields the same hash, so objects are stored and retrieved by their checksum.
What is the .git directory, and what does it contain?
It is the repository — the hidden directory Git creates on git init or git clone that stores all objects, refs, the config, HEAD, the index, hooks, and logs; it is the heart of a Git repo.
Name key items you would find inside the .git directory.
objects/ (the object database), refs/ (branch and tag pointers), HEAD (current ref), config (local config), index (staging area), hooks/, and logs/.
What is a reference (ref) in Git?
A human-friendly named pointer to a commit SHA-1, stored under .git/refs (e.g., branches in refs/heads, tags in refs/tags), so you don't have to remember raw hashes.
What is HEAD in Git?
A pointer to the current branch reference (usually a file .git/HEAD containing something like 'ref: refs/heads/main'); it indicates the branch/commit you currently have checked out.
What does it mean to be in a 'detached HEAD' state?
HEAD points directly to a specific commit rather than to a branch, so new commits are not on any branch and can be lost if you switch away without creating a branch.
Where are local branch pointers stored inside .git, and what do they contain?
In .git/refs/heads/, one file per branch, each containing the SHA-1 of the commit at the tip of that branch.
What is a shell (or terminal) and why is it central to using Git?
A shell is a command-line interpreter (e.g., Bash, Zsh, PowerShell) that runs typed commands; Git's full functionality is exposed through its command-line interface, run in a terminal.
Name a few essential shell navigation/file commands a Git user should know.
pwd (print working directory), ls (list files), cd (change directory), mkdir (make directory), rm (remove), and cp/mv (copy/move).
What is a Git alias, and how do you create one?
A shortcut for a longer Git command, created with git config, e.g., git config --global alias.co checkout lets you type 'git co' instead of 'git checkout'.
Give an example of a useful Git alias that shortens a common command.
git config --global alias.st status (so 'git st' runs 'git status'); other common ones are alias.ci commit, alias.br branch, and alias.unstage 'reset HEAD --'.
Compare Git GUI clients versus the command-line interface (CLI).
The CLI is the only place all Git commands are available and works everywhere identically; GUI clients (e.g., GitKraken, Sourcetree, GitHub Desktop) are more visual and beginner-friendly but implement only a subset of features, so learning the CLI ensures full capability.
Why is it recommended to learn the Git command line even if you plan to use a GUI?
Because GUIs only expose a subset of Git's functionality; knowing the CLI means you can perform any operation, understand what the GUI does under the hood, and work on any system where only a terminal is available.
Git & Version Control Version Control Fundamentals FAQ
What is in the Git & Version Control Version Control Fundamentals syllabus?
Git & Version Control Version Control Fundamentals is split into 4 chapters: Introduction to Version Control, Installing and Configuring Git, Git Internals and Data Model and Git on the Command Line. Together they contain 15 topics.
How many chapters are in Git & Version Control Version Control Fundamentals?
4 chapters, containing 15 topics. The largest chapter is Introduction to Version Control, with 4 topics.
Are there flashcards for Git & Version Control Version Control Fundamentals?
Yes — a 51-card Version Control Fundamentals deck, printed in full in the flashcards section of this page and available in the Examius app with spaced repetition. The free plan covers one exam of your choice, including its flashcards; Examius Pro, a one-time purchase, unlocks every other exam and deck.