Last active
December 31, 2015 21:39
-
-
Save aaronpowell/8048438 to your computer and use it in GitHub Desktop.
List remote git branches with a filter
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
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