← Git & GitHub learning path
Git & GitHub · Module 4 of 10

Branching

Work on features safely in branches.

📖 Key ideas

  1. A branch is an independent line of development.
  2. git branch feature creates; git switch feature moves to it.
  3. git switch -c feature creates and switches.
  4. main (or master) is the default branch.
  5. Keep main stable; build features in branches.
💡 Real-life example: Branches are parallel notebooks: try ideas in one without messing up the main notebook.
BranchIndependent line of work
mainDefault branch
git switchChanges branches
HEADPointer to current commit/branch