🌍 Git & Version Control · subject

Git & Version Control Branching and Merging Syllabus

Every chapter and topic of Branching and Merging examined in Git & Version Control — 6 chapters, 25 topics, plus 54 flashcards written against it.

6Chapters
25Topics
0Sub-topics
~20hEst. first pass
20%Of Git & Version Control
54Flashcards

Branching and Merging syllabus — full chapter and topic list

Expand any chapter to see its topics and sub-topics. This is the whole examinable outline for Branching and Merging in Git & Version Control, not a summary of it.

  1. Branch Fundamentals

    4 topics
    • What a Branch Really Is
    • Creating and Switching Branches
    • Listing, Renaming, and Deleting Branches
    • Tracking and Upstream Branches
  2. Merging Branches

    4 topics
    • Fast-Forward Merges
    • Three-Way Merges
    • Squash Merges
    • Aborting and Continuing Merges
  3. Resolving Merge Conflicts

    4 topics
    • Understanding Conflict Markers
    • Manual Conflict Resolution
    • Using Merge Tools
    • Strategies to Avoid Conflicts
  4. Rebasing

    4 topics
    • Rebase vs Merge
    • Interactive Rebase
    • The Golden Rule of Rebasing
    • Resolving Conflicts During Rebase
  5. Tagging and Releases

    4 topics
    • Lightweight vs Annotated Tags
    • Creating and Pushing Tags
    • Semantic Versioning
    • Checking Out and Deleting Tags
  6. Branching Strategies

    5 topics
    • Git Flow
    • GitHub Flow
    • GitLab Flow
    • Trunk-Based Development
    • Release and Hotfix Branches

Branching and Merging flashcards for Git & Version Control

23 of 54 cards from the Branching and Merging deck — real questions with worked answers.

  1. What is a Git branch, technically?

    A lightweight, movable pointer (a reference) to a specific commit. Because a commit records its parent(s), the branch pointer plus the commit history defines the whole line of development.

  2. Where does Git store the current branch pointer, and what file typically references it?

    Branch refs are stored under .git/refs/heads/ (or packed-refs). The special file .git/HEAD points to the current branch, usually as a symbolic ref like 'ref: refs/heads/main'.

  3. What does HEAD normally point to, and what is a 'detached HEAD'?

    HEAD normally points to the current branch (a symbolic reference). A detached HEAD occurs when HEAD points directly to a commit instead of a branch, so new commits are not recorded on any branch.

  4. Why is creating a branch in Git so cheap compared to older VCSs?

    A branch is just a 41-byte file containing a commit SHA-1 (plus newline). Git does not copy files; it only writes a new pointer, making branch creation nearly instantaneous.

  5. Which command creates a new branch without switching to it?

    git branch <name>. It creates a pointer at the current commit but leaves HEAD on the current branch.

  6. What is the modern command to create and switch to a new branch in one step (and the older equivalent)?

    Modern: git switch -c <name>. Older/equivalent: git checkout -b <name>.

  7. How do you create a new branch starting from a specific commit or another branch?

    git branch <name> <start-point> or git switch -c <name> <start-point>, where start-point is a commit SHA, tag, or branch name.

  8. What is the purpose-built command to switch branches introduced to reduce checkout's ambiguity?

    git switch <branch>. It only changes branches (unlike git checkout, which also restores files), making intent clearer and safer.

  9. How do you list all local branches, and how is the current branch marked?

    git branch. The current branch is marked with an asterisk (*) and often highlighted in color.

  10. Which flag lists remote-tracking branches, and which lists both local and remote?

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

  11. How do you rename the current branch, and how do you rename a different branch?

    Current: git branch -m <newname>. Another branch: git branch -m <oldname> <newname>. (-M forces the rename over an existing name.)

  12. What is the difference between git branch -d and git branch -D?

    -d deletes a branch only if it is already merged (safe delete). -D forces deletion even if unmerged, discarding those commits' reachability.

  13. Which flag shows the last commit on each branch when listing?

    git branch -v (verbose) shows the SHA and subject of each branch's tip commit; -vv also shows upstream tracking info.

  14. What is a tracking (upstream) branch?

    A local branch configured to have a direct relationship with a remote-tracking branch (its upstream). It lets commands like git pull, git push, and git status compare against the remote without naming it explicitly.

  15. How do you set the upstream for the current branch to origin/main?

    git branch --set-upstream-to=origin/main, or when pushing: git push -u origin <branch> (the -u/--set-upstream flag).

  16. In 'git status', what does 'Your branch is ahead of origin/main by 2 commits' mean?

    Your local branch has 2 commits that the upstream (origin/main) does not yet have; you would need to push to share them.

  17. What is the difference between a remote-tracking branch (e.g. origin/main) and a local tracking branch?

    A remote-tracking branch (origin/main) is a read-only local snapshot of the remote's state, updated by fetch. A local tracking branch (main) is your editable branch configured to track that remote-tracking branch.

  18. What is a fast-forward merge?

    A merge where the target branch's tip is a direct ancestor of the branch being merged, so Git simply moves the branch pointer forward to the incoming tip. No new merge commit is created.

  19. Under what condition is a fast-forward merge NOT possible?

    When the two branches have diverged, i.e., the current branch has commits not on the incoming branch. Their histories are not linear, so Git must perform a three-way merge.

  20. How do you force a merge commit even when a fast-forward is possible?

    git merge --no-ff <branch>. This always creates a merge commit, preserving the fact that a branch existed.

  21. What does git merge --ff-only do?

    It performs the merge only if it can be done as a fast-forward; otherwise it aborts with an error instead of creating a merge commit.

  22. What is a three-way merge?

    A merge that uses three commits: the two branch tips and their common ancestor (merge base). Git compares each side against the base to combine changes and creates a new merge commit with two parents.

  23. What is the 'merge base' in a three-way merge?

    The best common ancestor commit of the two branches being merged. It serves as the reference point for determining what changed on each side. You can find it with git merge-base A B.

See more Branching and Merging flashcards →

Planning Branching and Merging for Git & Version Control

Branching and Merging is about 20% of the Git & Version Control syllabus by topic count — 25 of 127 topics, spread over 6 chapters. At roughly 45 minutes per topic plus 12 minutes per sub-topic, a first pass runs to about 20 hours.

The heaviest chapters are Branching Strategies (5 topics), Branch Fundamentals (4 topics), Merging Branches (4 topics) . Front-load those while your energy is high; the short chapters are better revision filler later.

Work top-down: read the chapter, then tick topics off individually rather than marking the whole chapter done. Sub-topics are where silent gaps hide.

Branching and Merging (Git & Version Control) FAQ

What is in the Git & Version Control Branching and Merging syllabus?

Branching and Merging is split into 6 chapters — Branch Fundamentals, Merging Branches, Resolving Merge Conflicts, Rebasing, Tagging and Releases and Branching Strategies, containing 25 topics and 0 sub-topics in total.

How is Branching and Merging structured in the Git & Version Control syllabus?

6 chapters. Branching and Merging accounts for about 20% of the topics in the whole Git & Version Control syllabus (25 of 127).

How long should I spend on Branching and Merging for Git & Version Control?

Budget around 20 hours for a first pass through Branching and Merging — about 45 minutes per topic plus 12 minutes per sub-topic across its 25 topics. Add revision cycles on top.

Are there flashcards for Git & Version Control Branching and Merging?

Yes — a 54-card Branching and Merging deck. Sample cards are printed on this page, and the full deck is free in the Examius app with spaced repetition scheduling.