Skip to content

Instantly share code, notes, and snippets.

@thebentern
Last active January 5, 2016 19:01
Show Gist options
  • Save thebentern/6c26162fb8feacac04b3 to your computer and use it in GitHub Desktop.
Save thebentern/6c26162fb8feacac04b3 to your computer and use it in GitHub Desktop.
Unchuck git repo
$reader = [System.IO.File]::OpenText("GitChuck.txt")
try {
cd C:\Users\Source\MyRepo
for(;;) {
$line = $reader.ReadLine()
if ($line -eq $null) { break }
if($line -like '*bin*' -Or $line -like '*obj*' -Or $line -like '*suo*' -Or $line -like '*user*') {
git rm --cached $line
}
}
}
finally {
$reader.Close()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment