Skip to content

Instantly share code, notes, and snippets.

@scottgulliver
Created January 31, 2018 12:03
Show Gist options
  • Save scottgulliver/a4369484da598be87944f4afb16355e8 to your computer and use it in GitHub Desktop.
Save scottgulliver/a4369484da598be87944f4afb16355e8 to your computer and use it in GitHub Desktop.
Powershell script to checkout all remote git branches
git branch -r | Select-String -Pattern "->" -NotMatch | Select-String -pattern "^ origin/" | foreach { $_ -replace '^ origin/', '' } | Foreach { git checkout $_ }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment