Skip to content

Instantly share code, notes, and snippets.

@BenMcLean
Created November 29, 2017 23:19
Show Gist options
  • Save BenMcLean/4257b60ad5e605dab3b19ec167e1361e to your computer and use it in GitHub Desktop.
Save BenMcLean/4257b60ad5e605dab3b19ec167e1361e to your computer and use it in GitHub Desktop.
Use BFG to strip out old web builds from my repositories that use Github Pages
param ($name)
Set-PSDebug -Trace 2
git clone --mirror https://github.com/BenMcLean/$name.git
java -jar bfg.jar --delete-folders dist "$name.git"
cd ./$name.git
git push
cd..
Remove-Item -Path "$name.git" -Recurse -Force
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment