Skip to content

Commit fd7f20a

Browse files
committed
clean untracked files and directory
1 parent cab6261 commit fd7f20a

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@
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+
* [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)
4749

4850
<!-- Don’t remove or change the comment below – that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
4951
<!-- @doxie.inject end toc -->
@@ -299,5 +301,15 @@ git worktree add -b <branch-name> <path> <start-point>
299301
git worktree add --detach <path> HEAD
300302
```
301303

304+
## Forcefully remove untracked files
305+
```sh
306+
git clean -f
307+
```
308+
309+
## Forcefully remove unstracted directory
310+
```sh
311+
git clean -f -d
312+
```
313+
302314
<!-- Don’t remove or change the comment below – that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
303315
<!-- @doxie.inject end -->

tips.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,5 +169,13 @@
169169
{
170170
"title": "Create new working tree from HEAD state",
171171
"tip": "git worktree add --detach <path> HEAD"
172+
},
173+
{
174+
"title": "Forcefully remove untracked files",
175+
"tip": "git clean -f"
176+
},
177+
{
178+
"title": "Forcefully remove unstracted directory",
179+
"tip": "git clean -f -d"
172180
}
173181
]

0 commit comments

Comments
 (0)