tldr/pages/common/git-clean.md

24 lines
465 B
Markdown
Raw Normal View History

2016-11-18 15:31:10 +00:00
# git clean
> Remove untracked files from the working tree.
- Delete files that are not tracked by git:
`git clean`
- Interactively delete files that are not tracked by git:
`git clean -i`
2017-04-17 17:54:29 +01:00
- Show what 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
2017-02-04 10:37:09 +00:00
- Forcefully delete files that are not tracked by git:
2016-12-23 09:30:14 +00:00
`git clean -f`
2017-02-04 10:37:09 +00:00
- Delete untracked files, including ignored files in `.gitignore` and `.git/info/exclude`:
2016-12-23 09:30:14 +00:00
`git clean -x`