Protect Secrets and Generated Files

A local test run left artefacts behind and someone staged the production env file. Get the secret out and make the repository keep it out.

Project labbeginner~25 minFree

What you'll do

  • ✓Unstage a secret before it is committed
  • ✓Write ignore rules for files, directories and globs
  • ✓Prove a rule with git check-ignore
  • ✓Commit safe example config instead of real config

Lab outline

  1. 01Near miss
  2. 02Unstage
  3. 03Ignore rules
  4. 04Commit safely

Before you start

  • Staging and unstaging (the previous lab)

Every lab runs on a real machine of your own in the browser — no installs, nothing to clean up — and checks your work automatically as you go.

← All Git labs

Your first machine is
8 seconds away.

Learn by doing on real machines — and give every AI agent one of its own.

Free forever · No credit card · Cancel anytime

Protect Secrets and Generated Files — Git lab | Kube Labs