Skip to content

Add-GitChanges

SYNOPSIS

This cmdlet is a wrapper for the git command 'git add \<path>'.

SYNTAX

Add-GitChanges [-Path] <String[]> [[-RepositoryPath] <String>]
 [<CommonParameters>]

DESCRIPTION

This command selects the git changes from the working tree to prepare the content staged for the next commit.

EXAMPLES

Example 1

Set-Location -Path C:\MyGitRepo
Add-GitChanges -Path .\CHANGELOG.md

Would add the file CHANGELOG.md to the next commit in the git repository located at C:\MyGitRepo

PARAMETERS

-Path

The path(s) to the file(s) to be added to the next commit

Type: String[]
Parameter Sets: (All)
Aliases:

Required: True
Position: 2
Default value: None
Accept pipeline input: True (ByPropertyName, ByValue)
Accept wildcard characters: False

-RepositoryPath

The path to the git repository

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 3
Default value: $PWD
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

CommonParameters

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

INPUTS

OUTPUTS

NOTES