#requires -Version 5.1 # Point git at the versioned hooks in .githooks so every developer gets the # same pre-commit / pre-push gates. Run once after cloning. $ErrorActionPreference = 'Stop' $root = Split-Path $PSScriptRoot -Parent Push-Location $root try { git config core.hooksPath .githooks # Git for Windows runs hooks via its bundled bash; the files are sh scripts. Write-Host 'Git hooks installed (core.hooksPath -> .githooks):' -ForegroundColor Green Write-Host ' pre-commit : blocks committed secrets' Write-Host ' pre-push : runs backend + web unit tests' Write-Host '' Write-Host 'Bypass in an emergency with --no-verify (discouraged).' } finally { Pop-Location }