Skip to content
Foxipa
Code Completion 4 Challenges

Complete the Git commands: Git Clean: Safely Remove Untracked Working-Tree Content

Create a disposable repository with one committed file, one modified tracked file, one ordinary untracked file, one untracked directory, and one ignored file. Capture `git status --short --untracked-files=all`. Then use dry runs to demonstrate: default cleanup, directory cleanup with `-d`, ignored-only cleanup with `-X`, and combined ignored-plus-untracked cleanup with `-x`. Finally, safely delete exactly one disposable untracked file with a pathspec and `-f`. Your evidence must show that the modified tracked file remains untouched.

Advanced ~6 min read

Challenge 1

Complete the Git command to preview working-tree cleanup.

bash Your answer
git 

Press Ctrl⌘Enter to check your answer

Challenge 2

Complete the Git command to preview working-tree cleanup.

bash Your answer
git  -n

Press Ctrl⌘Enter to check your answer

Challenge 3

Complete the Git command to preview working-tree cleanup.

bash Your answer
git  -d

Press Ctrl⌘Enter to check your answer

Challenge 4

Complete the Git command to preview working-tree cleanup.

bash Your answer
git  -d -n

Press Ctrl⌘Enter to check your answer