Test-GitUncommittedChange

Tests for uncommitted changes in a git repository.

Syntax

Test-GitUncommittedChange [[-RepoRoot] <String>] [<CommonParameters>]

Description

The Test-GitUncommittedChange function checks for any uncommited changes in a git repository.

It defaults to the current repository and only the current branch. Use the RepoRoot parameter to specify an explicit path to another repo.

Implements the git diff --exit-code command ( No output if no uncommitted changes, otherwise output diff )

Parameters

Name Type Description Required? Pipeline Input Default Value
RepoRoot String

The repository to check for uncommitted changes. Defaults to current directory

false false (Get-Location).ProviderPath

EXAMPLE 1

Test-GitUncommittedChange -RepoRoot 'C:\Projects\LibGit2'

Demonstrates how to check for uncommitted changes in a repository that isn't the current directory.