Skip to content
Justice Tech School

Creating Branches

A branch is a movable pointer to a commit. git switch -c creates and moves to a new branch.

Example
echo one > a.txt && git add a.txt && git commit -qm 'first'
git switch -q -c feature
git branch
git branch --show-current

Result

* feature
  main
feature

Exercise

New branch.

git switch  feature

Quiz Test

What is a branch?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.