0/4

Lesson03

beginner

Create Your First Branch

Goal

Create branches with git branch and list them.

This repository has two commits on main. Create branches for upcoming work, and watch new labels appear in the Repository Graph without anything else changing.

Objectives

0/4
  1. Create a branch named feature/login. (Current objective)
  2. feature/login points at the same commit as main. Find both labels in the graph. (Not started)
  3. Create a second branch named bugfix/header. (Not started)
  4. Stay on main. Creating a branch does not switch to it. (Not started)

Your task nowStep 1 of 4

Create a branch named feature/login.

Need help?

Reference

Create a branch

$ git branch feature/login

Silent on success. The new branch points at the commit you are on, and you stay on your current branch.

List branches

$ git branch

* main
  feature/login

The * marks the branch HEAD points to, the one you are on.

Preparing your workspace…

Repository Graph

Click a commit to inspect it

0 commits

Working Tree

Not a Git repository yet

No unstaged changes

Your working tree matches the staging area.

Staging Area

Files prepared for the next commit

No staged changes

Use git add to prepare files for your next commit.

Repository

Committed history

No commits yet

Use git commit to record staged changes.