Skip to content

Commit d74c78a

Browse files
committed
get list of untracked files/directory
1 parent fd7f20a commit d74c78a

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,9 @@
4444
* [Show all ignored files](https://github.com/git-tips/tips#show-all-ignored-files)
4545
* [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)
4646
* [Create new working tree from HEAD state](https://github.com/git-tips/tips#create-new-working-tree-from-head-state)
47+
* [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)
4748
* [Forcefully remove untracked files](https://github.com/git-tips/tips#forcefully-remove-untracked-files)
48-
* [Forcefully remove unstracted directory](https://github.com/git-tips/tips#forcefully-remove-unstracted-directory)
49+
* [Forcefully remove untracked directory](https://github.com/git-tips/tips#forcefully-remove-untracked-directory)
4950

5051
<!-- Don’t remove or change the comment below – that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
5152
<!-- @doxie.inject end toc -->
@@ -301,12 +302,17 @@ git worktree add -b <branch-name> <path> <start-point>
301302
git worktree add --detach <path> HEAD
302303
```
303304

305+
## Before deleting untracked files/directory, do a dry run to get the list of untracked files/directory
306+
```sh
307+
git clean -n
308+
```
309+
304310
## Forcefully remove untracked files
305311
```sh
306312
git clean -f
307313
```
308314

309-
## Forcefully remove unstracted directory
315+
## Forcefully remove untracked directory
310316
```sh
311317
git clean -f -d
312318
```

tips.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,12 +170,16 @@
170170
"title": "Create new working tree from HEAD state",
171171
"tip": "git worktree add --detach <path> HEAD"
172172
},
173+
{
174+
"title": "Before deleting untracked files/directory, do a dry run to get the list of untracked files/directory",
175+
"tip": "git clean -n"
176+
},
173177
{
174178
"title": "Forcefully remove untracked files",
175179
"tip": "git clean -f"
176180
},
177181
{
178-
"title": "Forcefully remove unstracted directory",
182+
"title": "Forcefully remove untracked directory",
179183
"tip": "git clean -f -d"
180184
}
181185
]

0 commit comments

Comments
 (0)