Skip to content
  • Branching & Checkout · Git & GitHub

Branching & Checkout

LearnViaNotes @learnvianotes· 1 min read

Creating parallel lines of development to build features in isolation.

Branching Flow Chart

Commit 1 → Commit 2 (main) → Commit 3 (main)

Commit 2 (main) ↳ checkout new branch → Feature Commit A → Feature Commit B

Branching Commands

CommandPurposeDescription
git branchList BranchesLists all local branches in the repository.
git checkout [branch]Navigate BranchSwitches the working directory to the target branch.
git checkout -b [new-branch]Create & NavigateCreates a new branch and switches to it in one step.
git branch -d [branch]Delete BranchDeletes a branch (requires that changes are merged).

Free for students and teachers

Write notes like this one

Cards for every idea, quizzes and flashcards, read aloud — on the web and your phone.

Something wrong with this note? Open it to report