🌍 Front-end Web Development · subject
Front-end Web Development Version Control Syllabus
The Version Control syllabus for Front-end Web Development in full: 2 chapters and 6 topics, every one listed below, plus 50 Version Control flashcards with answers.
Version Control syllabus: all 2 chapters
Expand any chapter to see its topics and sub-topics.
-
Git Basics
3 topics- Repository Initialization
- Committing Changes
- Branching
-
GitHub
3 topics- Repositories
- Pull Requests
- Collaboration
Front-end Web Development Version Control flashcards — 50 questions with answers
What is version control (a.k.a. source control)?
A system that records changes to files over time so you can recall, compare, and restore specific versions later. It tracks history, enables collaboration, and supports parallel lines of development.
What is the difference between a centralized version control system (CVCS) and a distributed version control system (DVCS)?
In a CVCS (e.g., SVN) a single central server holds the repository and clients check out working copies. In a DVCS (e.g., Git) every clone is a full copy of the repository including its entire history, so most operations are local and there is no single point of failure.
What command initializes a new Git repository in the current directory?
git init — it creates a hidden .git subdirectory that stores all metadata, objects, and history for the repository.
What does the .git directory contain after running git init?
All repository data: the object database (commits, trees, blobs), refs (branches and tags), the HEAD pointer, the config file, hooks, and the index (staging area).
How do you create a local copy of an existing remote repository?
git clone <url> — it copies the entire repository (full history and all branches) and automatically sets up a remote named origin pointing to the source URL.
What is the difference between git init and git clone?
git init creates a brand-new empty repository in an existing or new directory; git clone copies an already-existing remote repository, including its history, and configures a remote (origin).
What are the three main states a file can be in within a Git working area?
Modified (changed but not yet staged), Staged (marked to go into the next commit), and Committed (safely stored in the local database).
What are the three main sections of a Git project?
The working directory (your checked-out files), the staging area / index (changes prepared for the next commit), and the .git directory / repository (where committed history is stored).
What command stages changes for the next commit?
git add <file> (or git add . to stage everything). It moves changes from the working directory into the staging area/index.
What command records the staged changes into the repository history?
git commit — typically git commit -m "message" to record staged changes with a descriptive commit message.
What does the -m flag do in git commit -m "message"?
It supplies the commit message inline on the command line, so Git does not open the default text editor to prompt for one.
What does git commit -a (or -am) do?
It automatically stages all already-tracked modified files and commits them in one step, skipping a separate git add. It does NOT include new (untracked) files.
What is a commit in Git?
A snapshot of the entire project at a point in time, identified by a unique SHA-1 hash, containing the author, committer, timestamp, message, and a pointer to its parent commit(s).
What uniquely identifies each commit in Git?
A 40-character SHA-1 hash computed from the commit's content (tree, parents, author, message). It is often abbreviated to the first 7 characters.
What command shows the commit history?
git log — it lists commits in reverse chronological order with their hashes, authors, dates, and messages. Flags like --oneline, --graph, and --all change the format.
What command shows the current state of the working directory and staging area?
git status — it reports staged, modified, and untracked files plus the current branch and its relationship to the remote.
What is the purpose of a .gitignore file?
It lists file patterns that Git should intentionally ignore (e.g., build artifacts, secrets, dependencies), preventing them from being tracked or staged.
How do you view the differences between the working directory and the last commit?
git diff shows unstaged changes; git diff --staged (or --cached) shows changes that are staged but not yet committed.
What is a branch in Git?
A lightweight, movable pointer to a specific commit. It represents an independent line of development; creating one just creates a new pointer rather than copying files.
What is the default branch name in a new Git repository?
Historically master; in modern Git and platforms like GitHub the default is main.
Show the other 30 Version Control flashcards
What command creates a new branch?
git branch <name> creates the branch (without switching to it); git checkout -b <name> or git switch -c <name> creates it and switches to it.
What command switches your working directory to a different branch?
git checkout <branch> or the newer git switch <branch>. HEAD then points to that branch and the working tree updates to match.
What is HEAD in Git?
A reference to the current commit you have checked out — usually a symbolic pointer to the tip of the current branch. It determines the parent of your next commit.
What is a detached HEAD state?
When HEAD points directly to a specific commit rather than to a branch. New commits made there are not on any branch and can be lost unless you create a branch to capture them.
What command combines the history of one branch into another?
git merge <branch> — run while on the receiving branch, it integrates the named branch's changes into the current branch.
What is a fast-forward merge?
A merge where the target branch's tip is a direct ancestor of the source branch, so Git simply moves the pointer forward with no new merge commit and no divergent history.
What is a three-way merge?
A merge used when two branches have diverged. Git combines the two branch tips using their common ancestor as the base and creates a new merge commit with two parents.
What is a merge conflict and when does it occur?
A conflict occurs when two branches change the same lines of a file (or one edits a file the other deletes) so Git cannot auto-merge. The user must manually resolve the marked regions and commit the result.
What markers does Git insert into a file to indicate a merge conflict?
Conflict markers: <<<<<<< for the start of your current branch's version, ======= separating the two sides, and >>>>>>> marking the end of the incoming branch's version.
What is the difference between git merge and git rebase?
Merge creates a new commit that joins two histories, preserving the branching structure. Rebase replays your commits on top of another branch's tip, producing a linear history but rewriting commit hashes.
What is the golden rule of git rebase?
Never rebase commits that have been pushed to a shared/public branch, because rebasing rewrites history and would break collaborators who based work on the original commits.
What is a remote in Git?
A named reference (commonly origin) to another copy of the repository hosted elsewhere (e.g., on GitHub), used as the target for fetching and pushing changes.
What does git fetch do?
It downloads new commits, branches, and tags from a remote into your local repository's remote-tracking branches, but does NOT modify your working files or current branch.
What does git pull do, and what two operations does it combine?
It updates your current branch from the remote by running git fetch followed by git merge (or git rebase with --rebase) of the corresponding upstream branch.
What does git push do?
It uploads your local commits to a remote repository, updating the remote branch to match your local branch (e.g., git push origin main).
What is the difference between git fetch and git pull?
git fetch only downloads remote changes into remote-tracking branches without touching your working branch; git pull additionally merges (or rebases) those changes into your current branch.
What is the difference between git clone and git fork?
Cloning copies a repository to your local machine. Forking (a GitHub/host feature) creates your own server-side copy of someone else's repository under your account, which you can then clone and submit pull requests from.
What is an upstream (tracking) branch?
The remote branch that a local branch is configured to track (e.g., origin/main). It lets git pull and git push work without specifying the remote and branch each time, and powers ahead/behind status reporting.
What is a pull request (PR)?
A request on a hosting platform (e.g., GitHub) to merge changes from one branch (or fork) into another. It enables code review, discussion, automated checks, and approval before integration.
What is the typical pull request workflow?
Create a feature branch, commit and push changes, open a PR against the target branch, undergo review and CI checks, address feedback, get approval, then merge and delete the branch.
What are the main merge options when completing a pull request on GitHub?
Create a merge commit (preserves all commits plus a merge commit), Squash and merge (combines all PR commits into one), and Rebase and merge (replays commits linearly onto the base with no merge commit).
What is the difference between a merge commit and a squash merge in a PR?
A merge commit keeps every individual commit from the branch plus a new merge commit, preserving detailed history. A squash merge condenses all branch commits into a single commit on the base branch, giving a cleaner but less granular history.
What is the fork-and-pull-request model used in open-source collaboration?
A contributor forks the upstream repo, clones their fork, creates a branch, pushes changes to their fork, and opens a pull request to the original repository. Maintainers review and merge it.
What is a code review in the context of pull requests?
The process where collaborators inspect proposed changes for correctness, style, and quality, leaving comments, requesting changes, or approving before the code is merged.
How do you incorporate changes from the original repository into your fork (keeping it up to date)?
Add the original repo as a remote (often named upstream), then git fetch upstream and merge or rebase its branch into your local branch, and push to your fork.
What command lets you reapply a specific commit from one branch onto another?
git cherry-pick <commit-hash> — it copies the changes introduced by that single commit and applies them as a new commit on the current branch.
What is the difference between git reset and git revert for undoing commits?
git reset moves the branch pointer back, rewriting history and optionally discarding changes (dangerous on shared branches). git revert creates a new commit that undoes a previous commit's changes, keeping history intact and safe for shared branches.
What is git stash used for?
It temporarily shelves uncommitted changes (saving a clean working directory) so you can switch context or branches, then restore them later with git stash pop or git stash apply.
What is a tag in Git and how does it differ from a branch?
A tag is a fixed reference to a specific commit, typically marking release points (e.g., v1.0). Unlike a branch, a tag does not move as new commits are added.
What is the difference between a lightweight tag and an annotated tag?
A lightweight tag is just a named pointer to a commit. An annotated tag is a full Git object storing the tagger's name, email, date, a message, and an optional GPG signature, making it preferred for releases.
Front-end Web Development Version Control FAQ
What is in the Front-end Web Development Version Control syllabus?
Front-end Web Development Version Control is split into 2 chapters: Git Basics and GitHub. Together they contain 6 topics.
How many chapters are in Front-end Web Development Version Control?
2 chapters, containing 6 topics. The largest chapter is Git Basics, with 3 topics.
Are there flashcards for Front-end Web Development Version Control?
Yes — a 50-card Version Control 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.