diff --git a/README.md b/README.md index 312d0fb..26e2fe8 100644 --- a/README.md +++ b/README.md @@ -44,8 +44,9 @@ * [Show all ignored files](https://github.com/git-tips/tips#show-all-ignored-files) * [Create new working tree from a repository (git 2.5)](https://github.com/git-tips/tips#create-new-working-tree-from-a-repository-git-25) * [Create new working tree from HEAD state](https://github.com/git-tips/tips#create-new-working-tree-from-head-state) +* [Before deleting untracked files/directory, do a dry run to get the list of untracked files/directory](https://github.com/git-tips/tips#before-deleting-untracked-filesdirectory-do-a-dry-run-to-get-the-list-of-untracked-filesdirectory) * [Forcefully remove untracked files](https://github.com/git-tips/tips#forcefully-remove-untracked-files) -* [Forcefully remove unstracted directory](https://github.com/git-tips/tips#forcefully-remove-unstracted-directory) +* [Forcefully remove untracked directory](https://github.com/git-tips/tips#forcefully-remove-untracked-directory) @@ -301,12 +302,17 @@ git worktree add -b git worktree add --detach HEAD ``` +## Before deleting untracked files/directory, do a dry run to get the list of untracked files/directory +```sh +git clean -n +``` + ## Forcefully remove untracked files ```sh git clean -f ``` -## Forcefully remove unstracted directory +## Forcefully remove untracked directory ```sh git clean -f -d ``` diff --git a/tips.json b/tips.json index 4594d8c..7bfb4aa 100644 --- a/tips.json +++ b/tips.json @@ -170,12 +170,16 @@ "title": "Create new working tree from HEAD state", "tip": "git worktree add --detach HEAD" }, + { + "title": "Before deleting untracked files/directory, do a dry run to get the list of untracked files/directory", + "tip": "git clean -n" + }, { "title": "Forcefully remove untracked files", "tip": "git clean -f" }, { - "title": "Forcefully remove unstracted directory", + "title": "Forcefully remove untracked directory", "tip": "git clean -f -d" } ]