mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-05-29 22:48:50 +02:00
Update clean-repo.ps1
This commit is contained in:
parent
a48756dc3e
commit
13ffbb9214
@ -1,6 +1,6 @@
|
|||||||
<#
|
<#
|
||||||
.SYNOPSIS
|
.SYNOPSIS
|
||||||
Clean a Git repository
|
Clean a repository
|
||||||
.DESCRIPTION
|
.DESCRIPTION
|
||||||
This PowerShell script deletes all untracked files and folders in a Git repository (including submodules).
|
This PowerShell script deletes all untracked files and folders in a Git repository (including submodules).
|
||||||
NOTE: To be used with care! This cannot be undone!
|
NOTE: To be used with care! This cannot be undone!
|
||||||
@ -25,7 +25,7 @@ try {
|
|||||||
& git --version
|
& git --version
|
||||||
if ($lastExitCode -ne "0") { throw "Can't execute 'git' - make sure Git is installed and available" }
|
if ($lastExitCode -ne "0") { throw "Can't execute 'git' - make sure Git is installed and available" }
|
||||||
|
|
||||||
"⏳ Step 2/3: Cleaning Git repository..."
|
"⏳ Step 2/3: Cleaning repository..."
|
||||||
& git -C "$RepoDir" clean -xfd -f # to delete all untracked files in the main repo
|
& git -C "$RepoDir" clean -xfd -f # to delete all untracked files in the main repo
|
||||||
if ($lastExitCode -ne "0") { throw "'git clean' failed with exit code $lastExitCode" }
|
if ($lastExitCode -ne "0") { throw "'git clean' failed with exit code $lastExitCode" }
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user