cli.fail

Practice this fail.

Whitespace has entered the chat.

Git · Restart as often as you like

Read the error, choose a command, and learn
why it works. Nothing runs on your machine.

Browse all practice ↗

Git · Intermediate

Inspect the staged patch for whitespace errors before committing. Do not modify files or inspect only unstaged edits.

Whitespace has entered the chat.

$ git diff --cached --stat

src/app.js | 3 +++

Which command checks staged changes for whitespace errors?

3 attempts remaining

Read why this fix works

Whitespace has entered the chat.

git diff --cached --check

Combining --cached and --check checks the proposed commit’s patch for whitespace errors and conflict markers. A nonzero exit status signals problems; it does not repair them.

Practice rounds do not affect the daily score or local streak. Try today’s challenge, or choose another scenario.

Copy your result