From fd7f20a3952656d930df9de35414e2f6ee331ac5 Mon Sep 17 00:00:00 2001 From: Anchal Date: Tue, 11 Aug 2015 11:41:10 +0530 Subject: [PATCH 1/5] clean untracked files and directory --- README.md | 12 ++++++++++++ tips.json | 8 ++++++++ 2 files changed, 20 insertions(+) diff --git a/README.md b/README.md index 535cae0..312d0fb 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,8 @@ * [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) +* [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) @@ -299,5 +301,15 @@ git worktree add -b git worktree add --detach HEAD ``` +## Forcefully remove untracked files +```sh +git clean -f +``` + +## Forcefully remove unstracted directory +```sh +git clean -f -d +``` + diff --git a/tips.json b/tips.json index ef8d003..4594d8c 100644 --- a/tips.json +++ b/tips.json @@ -169,5 +169,13 @@ { "title": "Create new working tree from HEAD state", "tip": "git worktree add --detach HEAD" + }, + { + "title": "Forcefully remove untracked files", + "tip": "git clean -f" + }, + { + "title": "Forcefully remove unstracted directory", + "tip": "git clean -f -d" } ] From d74c78a473d9d2c42398b7c9cb5c27b2aa0ce8d9 Mon Sep 17 00:00:00 2001 From: Anchal Date: Tue, 11 Aug 2015 11:47:49 +0530 Subject: [PATCH 2/5] get list of untracked files/directory --- README.md | 10 ++++++++-- tips.json | 6 +++++- 2 files changed, 13 insertions(+), 3 deletions(-) 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" } ] From 9ac4b5be057ac2b7c06dcf281c07c3101986d81b Mon Sep 17 00:00:00 2001 From: Anchal Date: Tue, 11 Aug 2015 11:48:14 +0530 Subject: [PATCH 3/5] get list of untracked files/directory --- README.md | 4 ++-- tips.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 26e2fe8..138fe60 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ * [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) +* [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) @@ -302,7 +302,7 @@ 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 +## Before deleting untracked files/directory, do a dry run to get the list of these files/directories ```sh git clean -n ``` diff --git a/tips.json b/tips.json index 7bfb4aa..3f4034e 100644 --- a/tips.json +++ b/tips.json @@ -171,7 +171,7 @@ "tip": "git worktree add --detach HEAD" }, { - "title": "Before deleting untracked files/directory, do a dry run to get the list of untracked files/directory", + "title": "Before deleting untracked files/directory, do a dry run to get the list of these files/directories", "tip": "git clean -n" }, { From 5da7631c2370528a27aad6a8672175ab6917764c Mon Sep 17 00:00:00 2001 From: Anchal Date: Tue, 11 Aug 2015 12:18:39 +0530 Subject: [PATCH 4/5] alternative for cleaning untracked directory --- tips.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tips.json b/tips.json index 3f4034e..843d513 100644 --- a/tips.json +++ b/tips.json @@ -180,6 +180,7 @@ }, { "title": "Forcefully remove untracked directory", - "tip": "git clean -f -d" + "tip": "git clean -f -d", + "alternatives": "git clean -df" } ] From f7ac6d21b6f857c128f2a9478b5b6a9dde62c209 Mon Sep 17 00:00:00 2001 From: Anchal Date: Tue, 11 Aug 2015 12:19:37 +0530 Subject: [PATCH 5/5] alternative for cleaning untracked directory --- README.md | 6 ++++++ tips.json | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 138fe60..0206762 100644 --- a/README.md +++ b/README.md @@ -317,5 +317,11 @@ git clean -f git clean -f -d ``` + +__Alternatives:__ +```sh +git clean -df +``` + diff --git a/tips.json b/tips.json index 843d513..f9dd009 100644 --- a/tips.json +++ b/tips.json @@ -181,6 +181,6 @@ { "title": "Forcefully remove untracked directory", "tip": "git clean -f -d", - "alternatives": "git clean -df" + "alternatives": ["git clean -df"] } ]