![]() This can be used (possibly in conjunction with git restore or git reset) to create a pristine working directory to test a clean build. This allows removing all untracked files, including build products. xĭon’t use the standard ignore rules (see gitignore(5)), but still use the ignore rules given with -e options from the command line. Use the given exclude pattern in addition to the standard ignore rules (see gitignore(5)). q, -quietīe quiet, only report errors, but not the files that are successfully removed. n, -dry-runĭon’t actually remove anything, just show what would be done. Show what would be done and clean files interactively. git subdirectory) unless a second -f is given. Git will refuse to modify untracked nested git repositories (directories with a. If the Git configuration variable clean.requireForce is not set to false, git clean will refuse to delete files or directories unless given -f or -i. If any paths are specified, -d is irrelevant all untracked files matching the specified paths (with exceptions for nested git directories mentioned under -force) will be removed. Specify -d to have it recurse into such directories as well. Normally, when no is specified, git clean will not recurse into untracked directories to avoid removing too much. arguments are given, only those paths are affected. This can, for example, be useful to remove all build products. Normally, only files unknown to Git are removed, but if the -x option is specified, ignored files are also removed. DescriptionĬleans the working tree by recursively removing files that are not under version control, starting from the current directory. Delete untracked files, including ignored files in.Forcefully delete directories that are not tracked by git: git clean -fd.Forcefully delete files that are not tracked by git: git clean -f.Show what files would be deleted without actually deleting them: git clean -dry-run.Interactively delete files that are not tracked by git: git clean -i.Delete files that are not tracked by git: git clean.Git-clean - Remove untracked files from the working tree Examples (TL DR)
0 Comments
Leave a Reply. |