Skip to content

Remove LocalBranches

Nick Spreitzer edited this page Nov 16, 2019 · 6 revisions
external help file: RemoveLocalBranches-help.xml
Module Name: WhatsNew
schema: 2.0.0

Remove-LocalBranches

SYNOPSIS

Deletes all local git branches - except for master - from the current respository.

SYNTAX

Remove-LocalBranches [-Force] [<CommonParameters>]

DESCRIPTION

Removes all merged, non-master branches from your local git repository. Use -Force to remove all non-master branches, regardless of merge status.

EXAMPLES

Example 1

PS C:\> Remove-LocalBranches -F

All branches are removed, leaving only master.

PARAMETERS

-Force

Deletes all braches regardless of merge status.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

OUTPUTS

NOTES

RELATED LINKS

Remove-LocalBranches