Skip to content

Instantly share code, notes, and snippets.

@natelowry
Last active December 6, 2017 21:08
Show Gist options
  • Save natelowry/7d8dd0ea7da3070448a824aa7261ee3b to your computer and use it in GitHub Desktop.
Save natelowry/7d8dd0ea7da3070448a824aa7261ee3b to your computer and use it in GitHub Desktop.
Don't push to master on Windows (put these in .git/hooks/)
#!C:/Program\ Files/Git/usr/bin/sh.exe
exec powershell.exe -NoProfile -ExecutionPolicy Bypass -File ".\.git\hooks\pre-push.ps1"
$currentBranch = git symbolic-ref HEAD
If ($currentBranch -eq "refs/heads/master") {
'DON''T PUSH TO MASTER!!!'
exit 1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment