LearnViz CompSci
Home / Learn / DevOps & Tooling / Branching and Merging

Beginner Topic 8 of 50 DevOps & Tooling

Branching and Merging

Parallel lines of development and combining them.

How it works

A branch is a movable pointer to a commit, so creating one is nearly free. Developers branch to work on a feature or fix in isolation, then merge it back. A fast-forward merge simply moves the pointer when no divergence exists, while a three-way merge creates a merge commit joining two lines of history. Rebase instead replays commits on top of another branch for a linear history, and squash merging collapses a branch into one commit. Tools such as git switch, git merge and git branch -d manage the cycle.

Where it is used

Teams use branches for feature work, release lines, hotfixes and experiments, and combine them with pull requests and CI checks before merging into main.

Common pitfall

Long-lived branches drift and produce painful conflicts, and rebasing commits that others already pulled rewrites shared history. Keep branches short, sync with main often and agree on a merge strategy for the team.

Where it fits in the course

Branching and Merging is topic 8 of 50 in DevOps & Tooling, rated Beginner. It follows Git Basics. The next topic is Pull Requests.

Practice and explore

How to study this topic

  1. Read the explanation above and restate the definition in your own words.
  2. Open the interactive lesson and answer its mini quiz.
  3. Read the common pitfall, then write a short example that avoids it.
  4. Check your understanding in the DevOps & Tooling quiz, and revisit the topic if you miss a question.

Frequently asked questions

What is Branching and Merging?
Parallel lines of development and combining them. It belongs to DevOps & Tooling and is a beginner-level topic.
Where do people use Branching and Merging?
Teams use branches for feature work, release lines, hotfixes and experiments, and combine them with pull requests and CI checks before merging into main.
What is the most common mistake with Branching and Merging?
Long-lived branches drift and produce painful conflicts, and rebasing commits that others already pulled rewrites shared history.
What should I learn before this topic?
Start with Git Basics, the topic just before it in DevOps & Tooling.
How can I practice it?
Answer the mini quiz in the interactive lesson, then take the DevOps & Tooling quiz.
Is Branching and Merging hard to learn?
It is a Beginner topic, so it works as an entry point. If the terms are new, read the explanation twice and try the visualizer before the quiz.
How long does it take to learn Branching and Merging?
Most learners can read the explanation and finish the interactive lesson in under an hour. Fluency comes from applying the idea, so plan a few short practice sessions with the quiz.
Which topics are related to Branching and Merging?
Git Basics, Pull Requests, Environment Variables are closely connected. The full list is in the related topics section of this page.
What should I study after Branching and Merging?
Continue with Pull Requests, the next topic in DevOps & Tooling.

Related topics