Git Clean

Download git eBook

Syntax

  • git clean [-d] [-f] [-i] [-n] [-q] [-e <pattern>] [-x | -X] [--] <path>

Parameters

ParameterDetails
-dRemove untracked directories in addition to untracked files. If an untracked directory is managed by a different Git repository, it is not removed by default. Use -f option twice if you really want to remove such a directory.
-f, --forceIf the Git configuration variable clean. requireForce is not set to false, git clean will refuse to delete files or directories unless given -f, -n or -i. Git will refuse to delete directories with .git sub directory or file unless a second -f is given.
-i, --interactiveInteractively prompts the removal of each file.
-n, --dry-runOnly displays a list of files to be removed, without actually removing them.
-q,--quietOnly display errors, not the list of successfully removed files.

Related Examples

Stats

74 Contributors: 6
Thursday, August 18, 2016
Licensed under: CC-BY-SA

Not affiliated with Stack Overflow
Rip Tutorial: info@zzzprojects.com

Download eBook