Skip to content

Git clean

git clean is a command used to remove untracked files from the working directory^[600-developer-tools-git-git-command.md].

Syntax and Flags

The command supports flags to define the scope of the cleaning process.

To remove both untracked files and untracked directories, the flags -f (force) and -d (directory) are combined^[600-developer-tools-git-git-command.md]:

git clean -f -d

Sources

^[600-developer-tools-git-git-command.md]