git branch
git branch <name> [<start>] · git branch -d <name>
Risk: Careful
What it does
Makes, renames or deletes a branch. A branch is a sticky note on a commit.
When to use it
To start new work without touching main.
Example
$ git branch feature/login-formMake a new branch here. You stay where you are.
$ git branch -d feature/login-formDelete a branch that is already merged. Safe.
$ git branch -D old-ideaDelete it even if it is not merged. Careful!
$ git branch -m new-nameRename the branch you are on.
$ git branch --mergedWhich branches are already merged here?
Learn it in: A branch is a sticky note · Official docs