Public/Get-AllBranches.ps1

1
2
3
4
5
6
7
8
9
10
<#
    .SYNOPSIS
        Returns the name of all branches, local as well as remote branches, including
        the symbolic HEAD.
#>

function Get-AllBranches() {
    $branches = Invoke-NativeCommand git for-each-ref refs/ --format="%(refname:short)"
    @('HEAD') + $branches
}