Create a Branch

A branch is not a copy of your project. It is just a name pointing at one commit — about as heavy as a sticky note.

That is why branching in git is instant, and why making one costs you nothing. Creating a branch does not move you onto it or change any files.

Exercises

  1. Exercise 1. Create a branch called "feature" without switching to it. When you are done you should still be on main.
  2. Exercise 2. Usually you want to start working on the branch immediately. Create "feature" and switch to it in a single command.