1
0
mirror of https://github.com/jbranchaud/til synced 2026-01-05 08:08:02 +00:00

Add Delete All Untracked Files to git til.

This commit is contained in:
jbranchaud
2015-03-13 15:50:01 -05:00
parent 6fc6747369
commit 2240858a9a
2 changed files with 28 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
# Delete All Untracked Files
Git provides a command explicitly intended for cleaning up (read: removing)
untracked files from a local copy of a repository.
> git-clean - Remove untracked files from the working tree
Git does want you to be explicit though and requires you to use the `-f`
flag to force it (unless otherwise configured).
Git also gives you fine-grained control with this command by defaulting to
only deleting untracked files in the current directory. If you want
directories of untracked files to be removed as well, you'll need the `-d`
flag.
So if you have a local repository full of files you'd like to get rid of,
just:
```bash
$ git clean -f -d
```
or just:
```bash
$ git clean -fd
```