From 95e654ceec5dc0e1ce673ed1202148dcdd2b1a69 Mon Sep 17 00:00:00 2001 From: Markus Fleschutz Date: Fri, 2 Jul 2021 11:46:01 +0200 Subject: [PATCH] Add extra -f to git clean --- Scripts/clean-repo.ps1 | 8 ++++---- Scripts/clean-repos.ps1 | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Scripts/clean-repo.ps1 b/Scripts/clean-repo.ps1 index bab58ddd..a26dd38b 100755 --- a/Scripts/clean-repo.ps1 +++ b/Scripts/clean-repo.ps1 @@ -18,11 +18,11 @@ try { $Null = (git --version) if ($lastExitCode -ne "0") { throw "Can't execute 'git' - make sure Git is installed and available" } - & git -C "$RepoDir" clean -fdx # force + recurse into dirs + don't use the standard ignore rules - if ($lastExitCode -ne "0") { throw "'git clean -fdx' failed" } + & git -C "$RepoDir" clean -xfd -f # force + recurse into dirs + don't use the standard ignore rules + if ($lastExitCode -ne "0") { throw "'git clean -xfd -f' failed" } - & git -C "$RepoDir" submodule foreach --recursive git clean -fdx - if ($lastExitCode -ne "0") { throw "'git clean -fdx' in submodules failed" } + & git -C "$RepoDir" submodule foreach --recursive git clean -xfd -f + if ($lastExitCode -ne "0") { throw "'git clean -xfd -f' in submodules failed" } [int]$Elapsed = $StopWatch.Elapsed.TotalSeconds "โœ”๏ธ cleaned Git repository ๐Ÿ“‚$RepoDirName in $Elapsed sec" diff --git a/Scripts/clean-repos.ps1 b/Scripts/clean-repos.ps1 index 9c30aba0..64002763 100755 --- a/Scripts/clean-repos.ps1 +++ b/Scripts/clean-repos.ps1 @@ -23,11 +23,11 @@ try { $FolderName = (get-item "$Folder").Name "๐Ÿงน Cleaning ๐Ÿ“‚$FolderName ..." - & git -C "$Folder" clean -fdx # force + recurse into dirs + don't use the standard ignore rules - if ($lastExitCode -ne "0") { throw "'git clean -fdx' failed" } + & git -C "$Folder" clean -xfd -f # force + recurse into dirs + don't use the standard ignore rules + if ($lastExitCode -ne "0") { throw "'git clean -xfd -f' failed" } - & git -C "$Folder" submodule foreach --recursive git clean -fdx - if ($lastExitCode -ne "0") { throw "'git clean -fdx' in submodules failed" } + & git -C "$Folder" submodule foreach --recursive git clean -xfd -f + if ($lastExitCode -ne "0") { throw "'git clean -xfd -f' in submodules failed" } } [int]$Elapsed = $StopWatch.Elapsed.TotalSeconds