AcademyTimeline Architect: Mastering the Time MachineProtocol 3: Branching Multiverses

Lesson 1: The Parallel Universe

Imagine you could create a parallel universe where you experiment freely — and if the experiment succeeds, merge it back into reality. If it fails, just delete that universe. No consequences. That's what branches do in Git.

What is a Branch?

A branch is a separate line of development. It's a copy of your project where you can make changes without affecting the main branch.

main:     A ── B ── C
                     \
feature:              D ── E ── F
  • main stays stable while feature evolves independently.
  • When the feature is ready, you merge it back.

Why Branches Matter in DevOps

  • Feature branches — Each new feature gets its own branch.
  • Hotfix branches — Emergency fixes without disrupting development.
  • Release branches — Prepare a release while development continues.
  • Environment branchesstaging, production reflect deployed states.

Creating a Branch

git branch feature/login        # Create a new branch
git checkout feature/login      # Switch to it

Or the shortcut:

git checkout -b feature/login   # Create AND switch in one command

Switching Branches

git checkout main               # Switch back to main
git switch feature/login        # Modern alternative to checkout

Listing Branches

git branch                      # Local branches
git branch -a                   # All branches (including remote)
git branch -v                   # Branches with last commit info

Branch Naming Conventions

| Pattern | Example | Use Case | |---------|---------|----------| | feature/ | feature/user-auth | New features | | bugfix/ | bugfix/login-crash | Bug fixes | | hotfix/ | hotfix/security-patch | Urgent production fixes | | release/ | release/v2.0 | Release preparation |

booting...

Mission Objective

Create your first parallel universe:

  1. Create it: Run git branch feature/login to create a new branch.
  2. Enter it: Switch to it with git checkout feature/login.
  3. Survey: Run git branch -a to see all branches.

Mission Control

Create a new branch

Expected Command

git branch feature/login

Switch to the new branch

List all branches