Skip to content

Instantly share code, notes, and snippets.

@rmjoia
Last active November 16, 2023 20:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rmjoia/393c34033ff36d95c37150761c185738 to your computer and use it in GitHub Desktop.
Save rmjoia/393c34033ff36d95c37150761c185738 to your computer and use it in GitHub Desktop.
githubooks cheat sheet

To activate the hooks, rename the existing *.sample file, by removing the .sample extension

The following example shows how to run a powershell script as a githook

the hooks can be found in your repo directory under .git/hooks/

pre-commit

#!/bin/sh
pwsh -ExecutionPolicy RemoteSigned -File '.git\hooks\pre-commit.ps1'

pre-commit.ps1

command to run / code to execute
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment