Git Course 0%

Branches

Branches are how a team works on many things at once without stepping on each other. This section replaces the mystery with a picture (a branch is a label on a commit), then walks through every branch operation you will use: create, switch, publish, update from main, compare, merge, rebase, delete. The merge lesson shows the three ways a branch lands in main and what history looks like after each; the rebase lesson tells you when rebase is a good idea and when it is dangerous.

Before you start: The Git Mental Model (especially HEAD and refs) and Everyday Git. Labs 1 and 2 done, with the playground connected to a remote, so the publishing lessons can be tried for real.

Lessons in this section

  1. What a branch really isIntermediate≈ 10 min
  2. Branch types and namingIntermediate≈ 8 min
  3. Create, switch, rename, deleteIntermediate≈ 12 min
  4. Publish, track, update from mainIntermediate≈ 12 min
  5. Compare branchesIntermediate≈ 7 min
  6. Merging: fast-forward, merge commit, squashIntermediate≈ 14 min
  7. Rebasing explained; merge or rebase?Intermediate≈ 14 min
  8. Remote branches and cleanupIntermediate≈ 8 min
  9. Protected branchesIntermediate≈ 7 min