tldr/pages/common/git-clean.md

29 lines
567 B
Markdown
Raw Normal View History

2016-11-18 15:31:10 +00:00
# git clean
> Remove files not tracked by Git from the working tree.
> More information: <https://git-scm.com/docs/git-clean>.
2016-11-18 15:31:10 +00:00
- Delete untracked files:
2016-11-18 15:31:10 +00:00
`git clean`
- [i]nteractively delete untracked files:
2016-11-18 15:31:10 +00:00
`git clean -i`
- Show which files would be deleted without actually deleting them:
2016-11-18 15:31:10 +00:00
`git clean --dry-run`
2016-12-23 09:30:14 +00:00
- [f]orcefully delete untracked files:
2016-12-23 09:30:14 +00:00
`git clean -f`
- [f]orcefully delete untracked [d]irectories:
2018-07-05 20:16:35 +01:00
`git clean -fd`
- Delete untracked files, including e[x]cluded files (files ignored in `.gitignore` and `.git/info/exclude`):
2016-12-23 09:30:14 +00:00
`git clean -x`