All challenges

Git · medium

Tip belongs on a feature

#13

Situation

You built the dark-theme toggle and committed it on main. That tip should have been a feature branch from the start. main needs to go back to the previous commit; the work must not vanish: label the tip first, then rewind main.

Objective

Point a new branch feature/dark-mode at the current tip, then put main back one commit with a hard reset. Stay on main. The feature branch keeps the dark-mode commit.

The repo at start

repo/
└── src/
    └── theme.ts   (committed on main by mistake)

Checks you will turn green

  • HEAD is main with one commit
  • feature/dark-mode kept the tip
  • theme.ts is gone from main's tree
  • Nothing staged

Concepts

resethard resetbranches

Play it in your terminal

With sharpen installed, this command opens exactly this challenge in your local arena:

sharpen 13

First time? The full install is right below.

How to play

  1. 1 Install Claude Code if you do not have it yet: claude.com/claude-code
  2. 2 Install sharpen from npm:
    npm install -g @juanwmedia/sharpen
  3. 3 Then launch it; the arena opens in your browser:
    sharpen 13
  4. or Or try it without installing anything:
    npx @juanwmedia/sharpen 13
  5. 4 And to update when a new version ships:
    sharpen update