間違えてmasterやdevelopにpushしてしまうあなたは今すぐこれを.git/hooks/pre-commitにコピペしなさいGit #!/bin/bash current_branch=$(git rev-parse --abbrev-ref HEAD) warn_branch() { echo "You can't commit on '$current_branch'!" } case $current_branch in master) warn_branch; exit 1 ;; # Of cource you can add any other important branches as you need. develop) warn_branch; exit 1 ;; # Of cource you can add any other important branch