All challenges

Git · easy

Leaked secret

#6

Situation

You are in pay-notify, the service that emails payment receipts. You staged a real fix in src/notify.ts, then to test against the real gateway you dropped the live Stripe key into .env and muscle memory added that too. Nothing is committed yet: the key is exactly one Enter away from living in history forever, but the notify fix still needs to stay ready to ship.

Objective

Take .env out of the staging area without deleting it from disk: you still need it to run the service locally. Leave the notify fix staged. History untouched.

The repo at start

repo/
├── .env             (staged - must never reach history)
├── README.md
└── src/
    └── notify.ts    (staged fix - this one should ship)

Checks you will turn green

  • The .env file survives on disk, untracked
  • The notify fix stays staged
  • History untouched on main

Concepts

stagingindexuntrackedsecretspathspec

Play it in your terminal

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

sharpen 6

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 6
  4. or Or try it without installing anything:
    npx @juanwmedia/sharpen 6
  5. 4 And to update when a new version ships:
    sharpen update