mirror of
https://github.com/git-tips/tips.git
synced 2024-09-21 00:01:03 +02:00
Merge pull request #24 from anchal20/master
Using clean to forcefully remove files/directory
This commit is contained in:
commit
395abfd730
24
README.md
24
README.md
|
@ -44,6 +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 these files/directories](https://github.com/git-tips/tips#before-deleting-untracked-filesdirectory-do-a-dry-run-to-get-the-list-of-these-filesdirectories)
|
||||
* [Forcefully remove untracked files](https://github.com/git-tips/tips#forcefully-remove-untracked-files)
|
||||
* [Forcefully remove untracked directory](https://github.com/git-tips/tips#forcefully-remove-untracked-directory)
|
||||
|
||||
<!-- Don’t remove or change the comment below – that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
|
||||
<!-- @doxie.inject end toc -->
|
||||
|
@ -299,5 +302,26 @@ git worktree add -b <branch-name> <path> <start-point>
|
|||
git worktree add --detach <path> HEAD
|
||||
```
|
||||
|
||||
## Before deleting untracked files/directory, do a dry run to get the list of these files/directories
|
||||
```sh
|
||||
git clean -n
|
||||
```
|
||||
|
||||
## Forcefully remove untracked files
|
||||
```sh
|
||||
git clean -f
|
||||
```
|
||||
|
||||
## Forcefully remove untracked directory
|
||||
```sh
|
||||
git clean -f -d
|
||||
```
|
||||
|
||||
|
||||
__Alternatives:__
|
||||
```sh
|
||||
git clean -df
|
||||
```
|
||||
|
||||
<!-- Don’t remove or change the comment below – that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
|
||||
<!-- @doxie.inject end -->
|
||||
|
|
13
tips.json
13
tips.json
|
@ -169,5 +169,18 @@
|
|||
{
|
||||
"title": "Create new working tree from HEAD state",
|
||||
"tip": "git worktree add --detach <path> HEAD"
|
||||
},
|
||||
{
|
||||
"title": "Before deleting untracked files/directory, do a dry run to get the list of these files/directories",
|
||||
"tip": "git clean -n"
|
||||
},
|
||||
{
|
||||
"title": "Forcefully remove untracked files",
|
||||
"tip": "git clean -f"
|
||||
},
|
||||
{
|
||||
"title": "Forcefully remove untracked directory",
|
||||
"tip": "git clean -f -d",
|
||||
"alternatives": ["git clean -df"]
|
||||
}
|
||||
]
|
||||
|
|
Loading…
Reference in New Issue
Block a user