Test-GitOutgoingCommit

Tests for un-pushed commits in a git repository.

Syntax

Test-GitOutgoingCommit [[-RepoRoot] <String>] [-All] [<CommonParameters>]

Description

The Test-GitOutgoingCommit function checks for un-pushed commits 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, and the All switch to test all local branches.

This function implements the git log remotes/origin/branch..branch command.

Parameters

Name Type Description Required? Pipeline Input Default Value
RepoRoot String

The repository to test for outgoing changes. Defaults to the current directory.

false false (Get-Location).ProviderPath
All SwitchParameter

Check for un-pushed commits on all branches. Otherwise, just current.

false false False

EXAMPLE 1

Test-GitOutgoingChange

Demonstrates how to check for unpushed commits in the current repo on the current branch.

EXAMPLE 2

Test-GitOutgoingCommit -RepoRoot 'C:\Projects\LibGit2' -All

Demonstrates how to check for unpushed commits on all branches of a repository that isn't the current directory.