Last active
December 6, 2017 21:08
-
-
Save natelowry/7d8dd0ea7da3070448a824aa7261ee3b to your computer and use it in GitHub Desktop.
Don't push to master on Windows (put these in .git/hooks/)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!C:/Program\ Files/Git/usr/bin/sh.exe | |
exec powershell.exe -NoProfile -ExecutionPolicy Bypass -File ".\.git\hooks\pre-push.ps1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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