Skip to content

Instantly share code, notes, and snippets.

@aaronpowell
Last active December 31, 2015 21:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aaronpowell/8048438 to your computer and use it in GitHub Desktop.
Save aaronpowell/8048438 to your computer and use it in GitHub Desktop.
List remote git branches with a filter
function List-RemoteGitBranches {
param (
[Parameter(Mandatory=$true)]
[string]
$Filter
)
$branches = git branch -r | ?{ $_ -Match $filter }
$count = $branches.Length
Write-Host "Found $count remote braches matching '$filter'"
return $branches
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment