Add extra -f to git clean

This commit is contained in:
Markus Fleschutz 2021-07-02 11:46:01 +02:00
parent 38b2cabfd1
commit 95e654ceec
2 changed files with 8 additions and 8 deletions

View File

@ -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"

View File

@ -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