0/4

Lesson05

beginner

Commit on a Feature Branch

Goal

Keep new work on its own branch, so main stays untouched.

You have written login.js, but it is not ready for main yet. Commit it on a feature branch instead, then switch back to main and see what happens to the file.

Objectives

0/4
  1. Create a branch named feature/login and switch to it. (Current objective)
  2. Commit login.js on feature/login. (Not started)
  3. main still points at Add homepage. Your commit is only on the feature branch. (Not started)
  4. Switch back to main, and notice that login.js leaves the working tree. (Not started)

Your task nowStep 1 of 4

Create a branch named feature/login and switch to it.

Need help?

Reference

What you are about to build

main stays on Add homepage while your work lives one commit ahead on feature/login.

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.