#!/bin/sh branch=$(git rev-parse --abbrev-ref HEAD) if [ "$branch" = "main" ]; then echo "direct commits to main are blocked." echo "create a feature branch: git checkout -b /" exit 1 fi