🌍 Back-end Web Developement · subject

Back-end Web Developement Version Control Syllabus

The Version Control syllabus for Back-end Web Developement in full: 3 chapters and 8 topics, every one listed below, plus 51 Version Control flashcards with answers.

3Chapters
8Topics
51Flashcards

Version Control syllabus: all 3 chapters

Expand any chapter to see its topics and sub-topics.

  1. Git Basics

    3 topics
    • Cloning Repositories
    • Branching
    • Merging
  2. Collaboration

    2 topics
    • Pull Requests
    • Code Reviews
  3. Advanced Git

    3 topics
    • Rebasing
    • Cherry-Picking
    • Stashing

Back-end Web Developement Version Control flashcards — 51 questions with answers

  1. What is a repository in Git version control?

    A repository (repo) is a data structure that stores a project's complete history, including all files, directories, commits, branches, and tags. It contains a hidden .git folder holding all version metadata.

  2. What does 'cloning a repository' mean, and which command performs it?

    Cloning creates a full local copy of a remote repository, including its entire history and branches. It is performed with git clone <url>.

  3. When you clone a repository, what remote is automatically created and what is it named by convention?

    Git automatically creates a remote pointing to the source URL, named origin by default.

  4. What is the difference between git clone and git fork?

    git clone makes a local copy of an existing repository on your machine. A fork creates a server-side copy of a repository under your own account (a hosting-platform feature, e.g. GitHub), which you then typically clone locally.

  5. How do you clone only a single branch instead of all branches?

    Use git clone --single-branch --branch <name> <url>, which fetches only the specified branch's history.

  6. What is a shallow clone, and how is it created?

    A shallow clone downloads only a limited portion of history rather than the full commit log, saving time and space. It is created with git clone --depth <n> <url>, keeping only the last n commits.

  7. After cloning, which branch is checked out by default?

    The remote's default branch (commonly main or master) is checked out automatically as the working branch.

  8. What is a branch in Git?

    A branch is a lightweight, movable pointer to a specific commit. It represents an independent line of development, allowing work to proceed without affecting other branches.

  9. What command creates a new branch and switches to it in one step?

    git checkout -b <name> or the modern equivalent git switch -c <name>.

  10. What is HEAD in Git?

    HEAD is a pointer that refers to the currently checked-out commit, usually the tip of the current branch. It determines which snapshot your working directory reflects.

  11. What is a 'detached HEAD' state?

    A detached HEAD occurs when HEAD points directly to a specific commit rather than to a branch. New commits made here are not attached to any branch and can be lost if not saved to a branch.

  12. How do you list all local branches, and how do you list remote branches too?

    git branch lists local branches; git branch -r lists remote branches; git branch -a lists both local and remote branches.

  13. How do you delete a local branch, and what is the difference between -d and -D?

    git branch -d <name> deletes a branch only if it has been merged; git branch -D <name> force-deletes it regardless of merge status.

  14. What is a tracking (upstream) branch?

    A tracking branch is a local branch that has a direct relationship to a remote branch. It lets Git know where to push and pull, and enables status messages like 'ahead by 2 commits'.

  15. What is merging in Git?

    Merging integrates changes from one branch into another, combining their histories. Git joins the divergent lines of development, typically creating a merge commit that has two parents.

  16. What is a fast-forward merge?

    A fast-forward merge occurs when the target branch has no new commits since the feature branch diverged, so Git simply moves the branch pointer forward to the feature branch's tip without creating a merge commit.

  17. What is a three-way merge?

    A three-way merge is used when both branches have diverged. Git uses three commits — the two branch tips and their common ancestor (merge base) — to compute the combined result and creates a new merge commit.

  18. What is a merge commit, and how many parents does it have?

    A merge commit records the integration of two branches. Unlike a normal commit with one parent, a merge commit has two (or more) parent commits.

  19. How do you force Git to always create a merge commit even when a fast-forward is possible?

    Use git merge --no-ff <branch>, which creates a merge commit to preserve the record that a branch was merged.

  20. What is a merge conflict and when does it occur?

    A merge conflict occurs when two branches make incompatible changes to the same lines of a file (or one deletes a file the other edits). Git cannot automatically decide which change to keep and requires manual resolution.

Show the other 31 Version Control flashcards
  1. What do the conflict markers <<<<<<<, =======, and >>>>>>> indicate in a file?

    They delimit conflicting regions: content between <<<<<<< and ======= is from the current branch (HEAD), and content between ======= and >>>>>>> is from the branch being merged.

  2. After manually resolving a merge conflict, what steps complete the merge?

    Edit the files to resolve conflicts, run git add <file> to mark them resolved, then git commit (or git merge --continue) to finalize the merge commit.

  3. How do you abort an in-progress merge and return to the pre-merge state?

    Run git merge --abort, which restores the branch to the state before the merge began.

  4. What is a pull request (PR)?

    A pull request is a request on a hosting platform (e.g. GitHub, GitLab merge request) to merge changes from one branch or fork into another. It provides a venue for review, discussion, and automated checks before merging.

  5. What is the difference between git pull and a pull request?

    git pull is a local command that fetches and merges remote changes into your current branch. A pull request is a collaboration/review workflow feature on a hosting platform for proposing and reviewing a merge.

  6. What does git pull do, and what two commands is it equivalent to?

    git pull downloads changes from a remote and integrates them into the current branch. It is equivalent to git fetch followed by git merge (or git rebase with --rebase).

  7. What is the difference between git fetch and git pull?

    git fetch downloads new data from the remote but does not modify your working branch. git pull fetches and then automatically merges (or rebases) those changes into your current branch.

  8. What are the three main states of a pull request on most platforms?

    Open (under review and discussion), Merged (changes integrated into the target branch), and Closed (rejected or abandoned without merging).

  9. What are the three common merge strategies offered when completing a pull request?

    Merge commit (preserves all commits plus a merge commit), Squash and merge (combines all commits into one), and Rebase and merge (replays commits onto the base with no merge commit).

  10. What is a 'draft' pull request?

    A draft pull request marks work as in-progress and not yet ready for review or merging. It blocks merging and signals to reviewers that changes are still being developed.

  11. What is the purpose of a code review?

    A code review is the systematic examination of proposed code changes by peers to catch bugs, ensure adherence to standards and style, improve design, share knowledge, and maintain overall code quality before merging.

  12. In code review, what is the difference between an 'Approve', 'Request Changes', and 'Comment' review outcome?

    Approve signals the changes are acceptable to merge; Request Changes blocks the merge until issues are addressed; Comment provides feedback without explicit approval or blocking.

  13. What is a CODEOWNERS file used for in code review?

    A CODEOWNERS file defines individuals or teams responsible for specific files or directories, so that changes to those paths automatically request review from the designated owners.

  14. What are 'branch protection rules' in the context of pull requests and reviews?

    Branch protection rules are repository settings that enforce requirements before merging into a protected branch, such as requiring approving reviews, passing status checks (CI), or up-to-date branches, and disallowing force-pushes.

  15. What is 'nit' feedback in a code review?

    A 'nit' (nitpick) is a minor, non-blocking comment about style or small preferences that the author may optionally address without holding up the merge.

  16. What is rebasing in Git?

    Rebasing moves or replays a sequence of commits onto a new base commit. It rewrites history to produce a linear sequence, as if the work had been started from the newer base.

  17. What is the key difference between merging and rebasing?

    Merging preserves history and combines branches with a merge commit, creating a non-linear history. Rebasing rewrites commits onto a new base, producing a clean linear history but changing commit hashes.

  18. What command rebases the current branch onto main?

    git rebase main (while on the feature branch), which replays the feature branch's commits on top of the latest main.

  19. What is interactive rebase and how is it started?

    Interactive rebase lets you edit, reorder, squash, drop, or reword commits during a rebase. It is started with git rebase -i <base>, opening an editor with a list of commits and actions.

  20. What is the 'golden rule of rebasing'?

    Never rebase commits that have been pushed to a shared/public branch that others may have based work on, because rewriting shared history forces disruptive updates for collaborators.

  21. In interactive rebase, what is the difference between the 'squash' and 'fixup' commands?

    squash combines a commit into the previous one and lets you edit the combined commit message; fixup does the same but discards the squashed commit's message, keeping only the previous one.

  22. How do you continue or abort a rebase that has stopped due to a conflict?

    Resolve conflicts and run git rebase --continue to proceed, or git rebase --abort to cancel and restore the branch to its original state.

  23. Why do commit hashes change after a rebase?

    A commit hash is computed from its content including its parent. Rebasing gives commits new parents (the new base), so their hashes are recalculated, producing brand-new commit objects.

  24. What is cherry-picking in Git?

    Cherry-picking applies the changes introduced by one or more specific commits from another branch onto the current branch, creating new commits with the same content but new hashes.

  25. What command cherry-picks a commit, and what identifies the commit?

    git cherry-pick <commit-hash>, where the commit is identified by its SHA hash (or a reference resolving to it).

  26. When is cherry-picking most useful?

    When you need a specific fix or feature from one branch without merging the entire branch — for example, applying a hotfix commit to a release branch while leaving other changes behind.

  27. How does cherry-picking differ from merging?

    Merging integrates all changes and history from a branch, whereas cherry-picking copies only selected individual commits' changes onto the current branch, without bringing over the rest of the branch's history.

  28. What does git cherry-pick -n (or --no-commit) do?

    It applies the commit's changes to the working directory and staging area but does not create a commit automatically, allowing you to review or combine changes before committing.

  29. What is stashing in Git and which command creates a stash?

    Stashing temporarily shelves uncommitted changes (modified tracked files and staged changes) so you can switch context with a clean working directory. It is created with git stash (or git stash push).

  30. How do you reapply the most recent stash, and what is the difference between git stash pop and git stash apply?

    git stash pop reapplies the most recent stash and removes it from the stash list; git stash apply reapplies it but keeps it in the stash list for reuse.

  31. How do you include untracked files when stashing, and how do you view the list of stashes?

    Use git stash -u (or --include-untracked) to stash untracked files as well; use git stash list to view all saved stashes (indexed as stash@{0}, stash@{1}, ...).

Back-end Web Developement Version Control FAQ

What is in the Back-end Web Developement Version Control syllabus?

Back-end Web Developement Version Control is split into 3 chapters: Git Basics, Collaboration and Advanced Git. Together they contain 8 topics.

How many chapters are in Back-end Web Developement Version Control?

3 chapters, containing 8 topics. The largest chapter is Git Basics, with 3 topics.

Are there flashcards for Back-end Web Developement Version Control?

Yes — a 51-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.