Skip to content

Instantly share code, notes, and snippets.

View rmcatog's full-sized avatar

Ryan Roman M Catog rmcatog

  • Davao City Water District
View GitHub Profile
#!/bin/bash
protected_branch='master'
current_branch=$(git symbolic-ref HEAD | sed -e 's,.*/\(.*\),\1,')
if [ $protected_branch = $current_branch ]
then
read -p "You're about to push master, is that what you intended? [y|n] " -n 1 -r < /dev/tty
echo
if echo $REPLY | grep -E '^[Yy]$' > /dev/null