Created
April 27, 2019 17:10
-
-
Save ghurlman/734d756ae27865d8e14b36d1af1e8a6a to your computer and use it in GitHub Desktop.
Nuke that repo from orbit with this simple command!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Put this in your $PROFILE! Or load it in from there. Whatever. | |
# Usage: | |
# gitnuke [path] | |
# | |
# If no path defined, uses the current directory | |
function gitnuke($path) | |
{ | |
if ($path -eq '') | |
{ | |
$path = "." | |
} | |
$reply = Read-Host -Prompt "Nuke back to a clean HEAD? [y/n]" | |
if ($reply -match "[yY]" ) { | |
Push-Location $path | |
git clean -xdf | |
git reset HEAD --hard | |
Pop-Location | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment