Creating a New Branch

Last Updated
August 16, 2026

A guide for creating a new branch in a git repository.

Creating a New Branch

  1. Navigate to git repo:
cd REPO
  1. Create new branch:
git checkout -b NEW-BRANCH
  1. Push new branch:
git push origin NEW-BRANCH

(Optionally) Create a Branch from a Specific Commit

git checkout -b NEW-BRANCH HASH

Swap Between Branches

git checkout BRANCH-NAME