< Back

Optimize-Repository

Mon Jan 13, 2020 8:36 pm

NAME Optimize-Repository



SYNOPSIS

Optimize a specified git repository.





SYNTAX

Optimize-Repository [-Name] <String[]> [-Path <String>] [-PassThru] [-WhatIf] [-Confirm] [<CommonParameters>]



Optimize-Repository [-Name] <String[]> [-LiteralPath <String>] [-PassThru] [-WhatIf] [-Confirm]

[<CommonParameters>]





DESCRIPTION

Runs "git gc --aggressive" on the specified repository.





PARAMETERS

-Name <String[]>

repositories to get latest on



Required? true

Position? 1

Default value

Accept pipeline input? true (ByValue)

Accept wildcard characters? false



-Path <String>

path to repositories folder, ${global:AF4JMsrcPath} if not specified



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-LiteralPath <String>

literal path to repositories folder, ${global:AF4JMsrcPath} if not specified



Required? false

Position? named

Default value

Accept pipeline input? false

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 repository 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:\\>Optimize-Repository -Name 'myRepo'













-------------------------- EXAMPLE 2 --------------------------



PS C:\\>'myRepo1','myRepo2','myRepo3' | Optimize-Repo















RELATED LINKS

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

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