mirror of
https://github.com/ivuorinen/cheatsheet-tldr.git
synced 2026-01-31 18:42:08 +00:00
34 lines
660 B
Plaintext
34 lines
660 B
Plaintext
---
|
|
syntax: markdown
|
|
tags: [tldr, common]
|
|
source: https://github.com/tldr-pages/tldr.git
|
|
---
|
|
# git clean
|
|
|
|
> Remove files not tracked by Git from the working tree.
|
|
> More information: <https://git-scm.com/docs/git-clean>.
|
|
|
|
- Delete untracked files:
|
|
|
|
`git clean`
|
|
|
|
- [i]nteractively delete untracked files:
|
|
|
|
`git clean -i`
|
|
|
|
- Show which files would be deleted without actually deleting them:
|
|
|
|
`git clean --dry-run`
|
|
|
|
- [f]orcefully delete untracked files:
|
|
|
|
`git clean -f`
|
|
|
|
- [f]orcefully delete untracked [d]irectories:
|
|
|
|
`git clean -fd`
|
|
|
|
- Delete untracked files, including e[x]cluded files (files ignored in `.gitignore` and `.git/info/exclude`):
|
|
|
|
`git clean -x`
|