Creating a Branch (git branch)

The 'git branch' command is used to list, create, or delete branches.

Usage

To create a new branch:

git branch [branch-name]

Explanation: Replace [branch-name] with the name you want for your new branch. This command creates the branch but doesn't switch to it.

Key Takeaways

  • 'git branch' can create a new branch based on the current HEAD.
  • You need to switch to the new branch to work on it.