Skip to content

Install-GitHooks

Synopsis

Installs a Git pre-push hook that runs Invoke-Build Build before each push.

Description

Creates or appends to the .git/hooks/pre-push file. If a pre-push hook already exists (e.g., from another tool), the Invoke-Build command is appended rather than overwriting the existing hook content.

Examples

Example 1: Installs the pre-push hook in the current repository

.\scripts\Install-GitHooks.ps1

Installs the pre-push hook in the current repository.

Inputs

None.

Outputs

None.