Skip to content

Instantly share code, notes, and snippets.

@potados99
Created August 18, 2024 03:33
Show Gist options
  • Save potados99/26503c7fcf910475ba254a79eb87b6d4 to your computer and use it in GitHub Desktop.
Save potados99/26503c7fcf910475ba254a79eb87b6d4 to your computer and use it in GitHub Desktop.
Pre commit hook
#!/bin/bash
[ "$(git symbolic-ref --short HEAD)" = "main" ] && echo "Pushing to main is not allowed." && exit 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment