Pulls or fetches remote changes for a repository


Receive-GitCommit [[-RepoRoot] <String>] [-Fetch] [<CommonParameters>]


The Recieve-GitCommit function fetches or pulls the remote changes for the specified repository.

If the -Fetch switch is used, all remotes are fetched. Otherwise, if the current branch can be fast-forwarded, the commits are pulled.

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

This function implements the git fetch --all and git pull commands.


Name Type Description Required? Pipeline Input Default Value
RepoRoot String

The repository to fetch updates for. Defaults to the current directory.

false false (Get-Location).ProviderPath
Fetch SwitchParameter

Use this switch to only fetch updates, instead of pulling

false false False


Receive-GitCommit -RepoRoot 'C:\Projects\LibGit2'

Demonstrates how to pull remotes changes for a repository that isn't the current directory.