< Back

Sync-Branch

Mon Jan 13, 2020 8:39 pm

NAME Sync-Branch



SYNOPSIS

Git checkout & rebase branches.





SYNTAX

Sync-Branch [[-Name] <String[]>] [-PassThru] [-WhatIf] [-Confirm] [<CommonParameters>]





DESCRIPTION

Checks out the local tracking branch and rebases it on the origin branch of the same name, for each branch

specified, assumes the current directory is in the git repository.





PARAMETERS

-Name <String[]>

string array of local tracking branches. If omitted rebases the current branch only



Required? false

Position? 1

Default value

Accept pipeline input? true (ByValue)

Accept wildcard characters? false



-PassThru [<SwitchParameter>]

Indicates whether the output of this function should be the function input or nothing.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-WhatIf [<SwitchParameter>]



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Confirm [<SwitchParameter>]



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

The branch name.





OUTPUTS

Pipeline input, if -PassThru is $true; otherwise this function does not generate any output.





NOTES





Author: John Meyer, AF4JM

Copyright (c) John Meyer. Licensed under the MIT License.

https://github.com/af4jm/GitHelper/blob/master/LICENSE



-------------------------- EXAMPLE 1 --------------------------



PS C:\\>git for-each-ref refs/heads --format="%(refname:short)" --sort=-committerdate | Sync-Branch















RELATED LINKS

https://www.powershellgallery.com/packages/GitHelper/

https://github.com/af4jm/GitHelper/